How to use same slot in two different forms

Hello folks,

I have two forms.

  1. order_status_form, slots: account name , order id
  2. order_return_form , slots: account_name, order_id

How can I use same slots in two different forms. ?

This is my existing slot in domain.yml file.

slots:
  account_name:
    type: text
    influence_conversation: true
    mappings:
      - type: from_text
        conditions:
         - active_loop: order_status_form
           requested_slot: account_name

Here, can I declare another slot with same name with different form name ‘order_return_form’ ?

Thanks,

Santhosh

Hello,

Yes, you can declare another slot with the same name but different form name in your domain.yml file. Each slot is associated with a specific form, so you can define the same slot name in multiple forms.

Here’s an example of how you can declare the same slot name in two different forms: slots: account_name: type: text influence_conversation: true mappings: - type: from_text conditions: - active_loop: order_status_form requested_slot: account_name - type: from_text conditions: - active_loop: order_return_form requested_slot: account_name

The account_name slot is associated with both the order_status_form and order_return_form forms. The mappings section specifies the conditions under which the slot should be filled for each form. You can define different conditions for each form based on your requirements.

Make sure to define the slot mappings correctly based on your form logic to ensure that the correct slot value is filled in each form.