# How to make changes in the incoming query message from user

**URL:** <https://forum.rasa.com/t/how-to-make-changes-in-the-incoming-query-message-from-user/5631>\
**Category:** Rasa Open Source\
**Created:** [March 1, 2019, 6:41am UTC](https://forum.rasa.com/t/how-to-make-changes-in-the-incoming-query-message-from-user/5631 "2019-03-01T06:41:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akshit](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akshit/32/1431_2.png) [@Akshit](https://forum.rasa.com/u/Akshit)\
**Post date:** [March 1, 2019, 6:41am UTC](https://forum.rasa.com/t/how-to-make-changes-in-the-incoming-query-message-from-user/5631/1 "2019-03-01T06:41:53Z")

</div>

Hi guys! So I need to make changes in the user message before passing it to the nlu. Where should I make these changes? Actually, the use case is like. If I have2 companies using same bot and there are let’s say 1 module in my app named lead. But for…

company1- lead = hospitals company2 - lead = lead.

So when a user types.

q1. How many new hospitals found?

Then first i will get a module name for the user and match the module in the query. So now if a module matches with query like here “Hostpitals” == “Leads” …So I will change the hospital in query to lead and then pass to bot.

I can’t use synonyms because user keeps changing the module names. and I need something dynamic to match these.

Can someone suggest me a solution for this?@akelad @JiteshGaikwad @Juste

---

<div class="post-metadata">

**Author:** ![huberrom](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/huberrom/32/1209_2.png) [@huberrom](https://forum.rasa.com/u/huberrom)\
**Post date:** [March 1, 2019, 9:06am UTC](https://forum.rasa.com/t/how-to-make-changes-in-the-incoming-query-message-from-user/5631/2 "2019-03-01T09:06:20Z")

</div>

You could use a custom components which will be first in your pipeline and which will make the changes, maybe by requeting something to be dynamic ?

---

<div class="post-metadata">

**Author:** ![Akshit](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akshit/32/1431_2.png) [@Akshit](https://forum.rasa.com/u/Akshit)\
**Post date:** [March 1, 2019, 9:29am UTC](https://forum.rasa.com/t/how-to-make-changes-in-the-incoming-query-message-from-user/5631/3 "2019-03-01T09:29:52Z")

</div>

Do you have an example for this? what changes are you suggesting in pipeline?

---

<div class="post-metadata">

**Author:** ![huberrom](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/huberrom/32/1209_2.png) [@huberrom](https://forum.rasa.com/u/huberrom)\
**Post date:** [March 1, 2019, 9:59am UTC](https://forum.rasa.com/t/how-to-make-changes-in-the-incoming-query-message-from-user/5631/4 "2019-03-01T09:59:59Z")

</div>

Well I have a spell checker and it’s changing the message before passing to the rest of the NLU. It’s look like this :

```auto
class SpellCheck(Component):
    """ Component put at the start of the pipeline to spell check the user message."""

    name = "SpellChecking"

    def __init__ (self, component_config=None):
        super(SpellCheck, self). __init__ (component_config)

    def process(self, message, **kwargs):
        # Here you can access the message with message.text and then change it
        message.text = correction

```
