How to set requested_slot to custom value

I have a form action asked for some information from people who used my service. And there are 4 slots to filling in ordered. some people do no want answered question in order. they have fourth intent when first question asked sometimes. So what should I do change the order of 4 slots or how to set requested_slot value to fixed slot value with people’s intent rather than automatically ordered slot? your early reply will be appreciated

Hi @fanlu, The form action sounds like the correct one to use for collecting information from your users to fill the 4 slots.

To help me understand what you are trying to achieve, can you provide a more detailed example of an utter_ask_{slot_name}, and how the users answer is resulting in wrong behavior?

If you are using Rasa X, a screenshot of an example conversation with the slots would be very helpful, off course not with actual data from your users, but something representative.

To change the slot order by some intent may be work.But I am not sure that this is the correct way.

  def required_slots(tracker: Tracker) -> List[Text]:
    """A list of required slots that the form has to fill"""
    if tracker.latest_message.get("intent", {}).get("name") == "ask_date":
      return ["deliveryDateConfirm", "customerNameConfirm", "orderInfoConfirm", "detailAddressConfirm", "deliveryDuration"]
      return ["customerNameConfirm", "orderInfoConfirm", "detailAddressConfirm", "deliveryDateConfirm", "deliveryDuration"]

There is another question, There are 2 slot left after 2 solts was filled. Then The user dose not answer the next slot question correctly. The bot is designed to supply another date to get user’s approval(from_intent) or ask convenient date from user(from_entity). but in

                if tracker.active_form.get("rejected"):
                    if self.state_is_unhappy(tracker, domain):
                        return result

if the user is in unhappy path. the form was designed to set validate to False and refuse extract slot from user input. What should I do next?

2019-12-09 17:45:33,945 DEBUG - Saving event from origin 'production' to event service
{"sender_id": "368ef5f83cf3463eabee404c20754679", "event": "action_execution_rejected", "timestamp": 1575884733.77557, "name": "deli
very_form", "policy": "policy_0_FormPolicy", "confidence": 1.0}                                                                     
2019-12-09 17:45:34,010 DEBUG - Saving event from origin 'production' to event service
{"sender_id": "368ef5f83cf3463eabee404c20754679", "event": "form_validation", "timestamp": 1575884733.777938, "validate": false}    
2019-12-09 17:45:34,071 DEBUG - Saving event from origin 'production' to event service
{"sender_id": "368ef5f83cf3463eabee404c20754679", "event": "action", "timestamp": 1575884733.786366, "name": "utter_explain_relative
_day", "policy": "policy_3_MappingPolicy", "confidence": 1}                                                                         
2019-12-09 17:45:34,137 DEBUG - Saving event from origin 'production' to event service
{"sender_id": "368ef5f83cf3463eabee404c20754679", "event": "bot", "timestamp": 1575884733.786371, "text": "2019-09-03\u60a8\u770b\u5
3ef\u4ee5\u5417", "data": {"elements": null, "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": nu
ll}, "metadata": {}}                                                                                                                
2019-12-09 17:45:34,199 DEBUG - Saving event from origin 'production' to event service
{"sender_id": "368ef5f83cf3463eabee404c20754679", "event": "action", "timestamp": 1575884733.794437, "name": "action_listen", "polic
y": "policy_3_MappingPolicy", "confidence": 1}                                                                                      
^[[B2019-12-09 17:49:44 DEBUG    rasa.core.tracker_store:256  - Recreating tracker for id '368ef5f83cf3463eabee404c20754679'        
2019-12-09 17:49:44 DEBUG    rasa.core.processor:267  - Canceled reminder because it is outdated. (event: action_timeout id: 877f246
2019-12-09 18:14:02 DEBUG    rasa.core.tracker_store:256  - Recreating tracker for id '368ef5f83cf3463eabee404c20754679'
2019-12-09 18:14:02 DEBUG    rasa.core.processor:343  - Received user message '可以的' with intent '{'name': 'confirm', 'confidence$
: 0.9257274270057678}' and entities '[]'                                                                                            
2019-12-09 18:14:02 DEBUG    rasa.core.processor:380  - Logged UserUtterance - tracker now has 36 events                            
2019-12-09 18:14:02 DEBUG    rasa.core.policies.form_policy:146  - There is an active form 'delivery_form'
2019-12-09 18:14:02 DEBUG    rasa.core.policies.form_policy:120  - stages: [{'entity_time': 1.0, 'active_form_delivery_form': 1.0, $
prev_utter_explain_relative_day': 1.0, 'intent_ask_relative_day': 1.0}, {'active_form_delivery_form': 1.0, 'prev_action_listen': 1.$
, 'intent_confirm': 1.0}]                                                                                                           
2019-12-09 18:14:02 DEBUG    rasa.core.policies.form_policy:122  - memorized_form: delivery_form                                    
2019-12-09 18:14:02 DEBUG    rasa.core.policies.form_policy:123  - tracker.active_form: delivery_form                               
2019-12-09 18:14:02 DEBUG    rasa.core.policies.form_policy:133  - There is a memorized tracker state [{'prev_utter_explain_relativ$
_day': 1.0}, {'active_form_delivery_form': 1.0, 'prev_action_listen': 1.0, 'intent_confirm': 1.0}], added `FormValidation(False)` event
2019-12-09 18:14:02 DEBUG    rasa.core.policies.memoization:207  - Current tracker state [{'active_form_delivery_form': 1.0, 'prev_$
elivery_form': 1.0, 'intent_welcome': 1.0}, {'entity_time': 1.0, 'active_form_delivery_form': 1.0, 'prev_action_listen': 1.0, 'inte$
t_ask_relative_day': 1.0}, {'entity_time': 1.0, 'active_form_delivery_form': 1.0, 'prev_utter_explain_relative_day': 1.0, 'intent_a$
k_relative_day': 1.0}, {'active_form_delivery_form': 1.0, 'prev_action_listen': 1.0, 'intent_confirm': 1.0}]
2019-12-09 18:14:02 DEBUG    rasa.core.policies.memoization:221  - There is no memorised next action
2019-12-09 18:14:02 DEBUG    rasa.core.policies.fallback:161  - NLU confidence threshold met, confidence of fallback action set to c
ore threshold (0.1).
2019-12-09 18:14:02 DEBUG    rasa.core.policies.ensemble:435  - Predicted next action using policy_2_KerasPolicy
2019-12-09 18:14:02 DEBUG    rasa.core.processor:209  - Predicted next action 'delivery_form' with confidence 1.00.
2019-12-09 18:14:02 DEBUG    rasa.core.actions.action:448  - Calling action endpoint to run action 'delivery_form'.