# Compare value with the intent in action.py

**URL:** <https://forum.rasa.com/t/compare-value-with-the-intent-in-action-py/34916>\
**Category:** Rasa Open Source\
**Created:** [September 28, 2020, 3:43am UTC](https://forum.rasa.com/t/compare-value-with-the-intent-in-action-py/34916 "2020-09-28T03:43:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_adityaK](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/_adityak/32/10899_2.png) [@\_adityaK](https://forum.rasa.com/u/_adityaK)\
**Post date:** [September 28, 2020, 3:43am UTC](https://forum.rasa.com/t/compare-value-with-the-intent-in-action-py/34916/1 "2020-09-28T03:43:19Z")

</div>

Hello,

I have a following line of code in my action.py file:

```
if tracker.get_slot('answer') == "Yes":
     // some logic...
     return []

```

If the slot value matches to “Yes”, we perform some action. But the user can input any variant of answer from “Yes”, “Yeah”, “Yes Please”… etc. How can I compare the slot value to intent from nlu.md. For me, the intent looks like:

```
## intent:boolean_answer_yes
   - yes
   - yeah
   - yep
   - please
   - please do
   - sure
   - indeed
   - of course
   - that sounds good

```

The condition needs to be like:

```
if tracker.get_slot('answer') == intent(boolean_answer_yes):
  // some logic...
  return []

```

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![stephens](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/stephens/32/1632_2.png) [@stephens](https://forum.rasa.com/u/stephens)\
**Post date:** [September 29, 2020, 3:18pm UTC](https://forum.rasa.com/t/compare-value-with-the-intent-in-action-py/34916/2 "2020-09-29T15:18:03Z")

</div>

You can check for the latest intent like this:

```auto
state = tracker.current_state()
intent = state["latest_message"]["intent"]["name"]

```
