# Using UserUttered to change intents in a custom action in Rasa

**URL:** <https://forum.rasa.com/t/using-useruttered-to-change-intents-in-a-custom-action-in-rasa/60772>\
**Category:** Rasa Open Source\
**Created:** [January 15, 2024, 7:05am UTC](https://forum.rasa.com/t/using-useruttered-to-change-intents-in-a-custom-action-in-rasa/60772 "2024-01-15T07:05:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RaiosMinis23](https://avatars.discourse-cdn.com/v4/letter/r/f4b2a3/32.png) [@RaiosMinis23](https://forum.rasa.com/u/RaiosMinis23)\
**Post date:** [January 15, 2024, 7:05am UTC](https://forum.rasa.com/t/using-useruttered-to-change-intents-in-a-custom-action-in-rasa/60772/1 "2024-01-15T07:05:33Z")

</div>

I’m developing a bot with Rasa and I have a question about the approach I’m using to change the intent during a conversation.

At a specific point of conversation (when the detected intent is intent\_a), if a specific condition is not met, I’m using a custom action (action\_trigger\_intent) to guide the conversation to the intent\_b. This action uses the UserUttered method to simulate user input with the new intention.

I need to force this intent change because it’s a condition checked within the bot, and this needs to be transparent to the user.

Here’s a snippet of my code:

```auto
 # file: stories-a.yml

version: "3.1"

stories:

- story: story A
  steps:
  - intent: intent_a
  - action: action_conditions_flow
  - slot_was_set:
    - conditions_flow: false
  - action: action_trigger_intent
  - checkpoint: checkpoint_change_intent

##################
# file: stories-b.yml

version: "3.1"

stories:

- story: story B
  steps:
  - intent: intent_b
  - checkpoint: checkpoint_change_intent
  - action: run_form
  - active_loop: run_form
  - active_loop: null
  - slot_was_set:
    - run: CORRECT
  - action: action_shadow_mode

#####################

class TriggerExternalIntentAction(Action):
    def name(self) -> str:
        return "action_trigger_intent"

    def run(self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[str, Any]) -> List[Dict[str, Any]]:
        data = { "intent": {
                        "name": "intent_b",
                        "confidence": 1.0,
                    }
               }

        return [UserUttered(text="/intent_b", parse_data=data)]

```

I would like to know if this is an appropriate approach or if there is a more efficient way to guide the conversation towards a specific intention in my case.
