# A rule for detect user's input in some conditions

**URL:** <https://forum.rasa.com/t/a-rule-for-detect-users-input-in-some-conditions/50750>\
**Category:** Feedback on Rasa Open Source\
**Created:** [January 20, 2022, 1:02pm UTC](https://forum.rasa.com/t/a-rule-for-detect-users-input-in-some-conditions/50750 "2022-01-20T13:02:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ILG2021](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ilg2021/32/18166_2.png) [@ILG2021](https://forum.rasa.com/u/ILG2021)\
**Post date:** [January 20, 2022, 1:02pm UTC](https://forum.rasa.com/t/a-rule-for-detect-users-input-in-some-conditions/50750/1 "2022-01-20T13:02:40Z")

</div>

Hello, everyone. I want to write a rule to describe the dialogue below: When a form is in active loop and requesting slot a, then user input a special text, then I set slot a to a value. I know entity or from text is a normal method, but in some unhappy path, I can’t use entity or intent. My rule is below

```auto
-rule:
 condition: 
   - active_loop: form xx
   - slot_was_set:
         - requested slot: slot_a
 steps:
   - slot_was_set:
       slot_a: true

```

I have tried this method but with no luck. Wish someone who is deep understand rule can help me.

---

<div class="post-metadata">

**Author:** ![RodrigoLima](https://avatars.discourse-cdn.com/v4/letter/r/58956e/32.png) [@RodrigoLima](https://forum.rasa.com/u/RodrigoLima)\
**Post date:** [January 20, 2022, 1:11pm UTC](https://forum.rasa.com/t/a-rule-for-detect-users-input-in-some-conditions/50750/2 "2022-01-20T13:11:50Z")

</div>

> [@ILG2021](#):
>
> Hello, everyone. I want to write a rule to describe the dialogue below: When a form is in active loop and requesting slot a, then user input a special text, then I set slot a to a value. I know entity or from text is a normal method, but in some unhappy path, I can’t use entity or intent. My rule is below

From what I understand: you can be doing this procedure inside the validate form

---

<div class="post-metadata">

**Author:** ![ILG2021](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ilg2021/32/18166_2.png) [@ILG2021](https://forum.rasa.com/u/ILG2021)\
**Post date:** [January 20, 2022, 1:16pm UTC](https://forum.rasa.com/t/a-rule-for-detect-users-input-in-some-conditions/50750/3 "2022-01-20T13:16:18Z")

</div>

> [@RodrigoLima](#):
>
> From what I understand: you can be doing this procedure inside the validate form

yes, in custom slot mapping extra\_xxx function is ok. Just I don’t think it is a gentle way.
