# Condition contraints on a rule - what am I doing wrong?

**URL:** <https://forum.rasa.com/t/condition-contraints-on-a-rule-what-am-i-doing-wrong/48293>\
**Category:** Rasa Open Source\
**Created:** [October 7, 2021, 11:45am UTC](https://forum.rasa.com/t/condition-contraints-on-a-rule-what-am-i-doing-wrong/48293 "2021-10-07T11:45:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pomegran](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/pomegran/32/16087_2.png) [@pomegran](https://forum.rasa.com/u/pomegran)\
**Post date:** [October 7, 2021, 11:45am UTC](https://forum.rasa.com/t/condition-contraints-on-a-rule-what-am-i-doing-wrong/48293/1 "2021-10-07T11:45:01Z")

</div>

Hi,

I am testing out some simple rules with conditions and struggling to get them to work.

In the example below, my slot “call\_fallback” is either “None” or “yes”. However, regardless of what my slot is set to, whenever I hit the intent “show\_slot”, it triggers the rule.

Should this rule not trigger if my slot is set to None i.e. the default value?

```auto
- rule: Show Slot
  condition: 
  - slot_was_set:
    - call_fallback: true
  steps:
  - intent: show_slot
  - action: utter_show_the_slot

```

My config simply has this line as a policy:

` - name: RulePolicy`

Thoughts?

Thanks Mark

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [October 7, 2021, 12:00pm UTC](https://forum.rasa.com/t/condition-contraints-on-a-rule-what-am-i-doing-wrong/48293/2 "2021-10-07T12:00:28Z")

</div>

> [@pomegran](#):
>
> `call_fallback`

@pomegran Hi, what is the type of call\_fallback mentioned in domain.yml ? or is influence is set to true of false ?

---

<div class="post-metadata">

**Author:** ![pomegran](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/pomegran/32/16087_2.png) [@pomegran](https://forum.rasa.com/u/pomegran)\
**Post date:** [October 7, 2021, 2:37pm UTC](https://forum.rasa.com/t/condition-contraints-on-a-rule-what-am-i-doing-wrong/48293/3 "2021-10-07T14:37:18Z")

</div>

Hi Nik,

I have made some progress.

I was not setting the slot’s “influence\_conversation” flag (the documentation said this was the default so I didn’t put it in!). I have now changed this to “true” and this rule now triggers (my slot is type ‘text’ by the way:

```auto
- rule: Show Slot
  condition: 
  - slot_was_set:
    - call_fallback: 'yes'
  steps:
  - intent: show_slot
  - action: utter_show_the_slot

```

That’s good news, so thank you for the pointer!

However, this was a test to try and trigger an action during a form field validation. In my custom form field validation I set the “call\_fallback” slot to ‘yes’ and try to trigger the action\_default\_fallback with this rule:

```auto
- rule: Call fallback
  condition: 
  - slot_was_set:
    - call_fallback: 'yes'
  steps:
  - action: action_default_fallback

```

However, it never triggers, I assume as I’m in a form with custom validation. I read this in the documentation but I’m not clear what it means:

> To intentionally reject the form execution, you can also return an `ActionExecutionRejected` event as part of your custom validations or slot mappings.

I’m not sure that this means or even how I execute it considering a slot validation only allows me to return slot values (list of key value pairs).

Is that clear? 🙂

Thanks Mark

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [October 8, 2021, 7:24am UTC](https://forum.rasa.com/t/condition-contraints-on-a-rule-what-am-i-doing-wrong/48293/4 "2021-10-08T07:24:36Z")

</div>

@pomegran can you share config.yml and did you mention the utter\_default in domain.yml ?

---

<div class="post-metadata">

**Author:** ![pomegran](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/pomegran/32/16087_2.png) [@pomegran](https://forum.rasa.com/u/pomegran)\
**Post date:** [October 8, 2021, 8:58am UTC](https://forum.rasa.com/t/condition-contraints-on-a-rule-what-am-i-doing-wrong/48293/5 "2021-10-08T08:58:14Z")

</div>

Hi Nik,

In summary, I am just trying to understand how I can exit a form slot if I am using custom validation i.e. how I call another action. To help demonstrate this I have a created a simple form (triggered by saying “start form”) that asks for text entry. The custom validation looks for the word “go” to proceed (obviously this is just for demonstration purposes). In this example, I can never leave the slot UNTIL I say “go” i.e. people can get stuck in the form unless they enter a valid input.

I have tried setting slots in the validation response to try and trigger another rule but they simply never trigger.

I have attached the files if you want to take a look?

Thanks Mark

[config.yml](https://forum.rasa.com/uploads/short-url/6xtJAxWzLUi3KQSoGcY1APxRs0P.yml) (1.1 KB) [domain.yml](https://forum.rasa.com/uploads/short-url/1ammVPOoXYLRYOHdJsKLJRZUwH6.yml) (549 Bytes) [endpoints.yml](https://forum.rasa.com/uploads/short-url/7VAXtyANQaNuYInUHvFp3Cr1kdJ.yml) (1.4 KB) [nlu.yml](https://forum.rasa.com/uploads/short-url/ox0d4VwVgBhWFCXAn3xGtLIOt2w.yml) (376 Bytes) [rules.yml](https://forum.rasa.com/uploads/short-url/3Lb1xA3Nc0Q18hexXDC2qjZu4a2.yml) (325 Bytes) [actions.py](https://forum.rasa.com/uploads/short-url/dpB1ybIrMOoqXWA0n27jA1YhTKJ.py) (902 Bytes)

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [October 10, 2021, 2:31pm UTC](https://forum.rasa.com/t/condition-contraints-on-a-rule-what-am-i-doing-wrong/48293/6 "2021-10-10T14:31:34Z")

</div>

@pomegran Sorry, for getting back to you late, as you not mentioned me so, I lost the message in unread.

Can you share some bot/user example so that I can dry run the code for you mark ? Please always mention @ and nik202.

@pomegran even update the stories file in above post.

 ![Screenshot 2021-10-10 at 3.42.24 PM](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/4/a/4ae8d2b40ce38bd1b7d6097dc7d56fadaa72d2da.png)

@pomegran now, what?

---

<div class="post-metadata">

**Author:** ![pomegran](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/pomegran/32/16087_2.png) [@pomegran](https://forum.rasa.com/u/pomegran)\
**Post date:** [October 27, 2021, 9:38pm UTC](https://forum.rasa.com/t/condition-contraints-on-a-rule-what-am-i-doing-wrong/48293/7 "2021-10-27T21:38:43Z")

</div>

Hi @nik202

Apologies for not seeing your message either!

If you take a look at the actions.py, I’ve commented in there. If I say anything else apart from go, how can I trigger the action\_default\_fallback action e.g. for the default fallback response?

I want to leverage features in my already existing action\_default\_fallback action to do things like count for repeated failures etc. Otherwise I am stuck in this slot until I say “go”, right?

Thanks for looking by the way. Any pointers appreciated.
