# Issue rasa check ? or statement

**URL:** <https://forum.rasa.com/t/issue-rasa-check-or-statement/11947>\
**Category:** Rasa Open Source\
**Created:** [June 24, 2019, 5:41am UTC](https://forum.rasa.com/t/issue-rasa-check-or-statement/11947 "2019-06-24T05:41:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hajoura](https://avatars.discourse-cdn.com/v4/letter/h/5f8ce5/32.png) [@hajoura](https://forum.rasa.com/u/hajoura)\
**Post date:** [June 24, 2019, 5:41am UTC](https://forum.rasa.com/t/issue-rasa-check-or-statement/11947/1 "2019-06-24T05:41:07Z")

</div>

if my customer action I would like to check if the user ask question or juste easy statement can you help me on that ? that my code but it is not working plz help me

class ActionQuestionMark(Action):

```
 def name(self):
     return "action_question_mark"
def run(self, dispatcher, tracker, domain):
    message = tracker.latest_message.text["text"]
    # dispatcher.utter_message("Hello World!")
    if message.endswith("?"):
    # Return a random question
        return dispatcher.utter_message("Question")
    else:
        return dispatcher.utter_message("statement")
```

---

<div class="post-metadata">

**Author:** ![gcgloven](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/gcgloven/32/3915_2.png) [@gcgloven](https://forum.rasa.com/u/gcgloven)\
**Post date:** [June 24, 2019, 9:03am UTC](https://forum.rasa.com/t/issue-rasa-check-or-statement/11947/2 "2019-06-24T09:03:19Z")

</div>

May I know if you have run “ **rasa run actions** ” on a separate terminal?

To run “rasa run actions” you need to “ **pip install rasa-sdk** ”

---

<div class="post-metadata">

**Author:** ![hajoura](https://avatars.discourse-cdn.com/v4/letter/h/5f8ce5/32.png) [@hajoura](https://forum.rasa.com/u/hajoura)\
**Post date:** [June 24, 2019, 4:59pm UTC](https://forum.rasa.com/t/issue-rasa-check-or-statement/11947/3 "2019-06-24T16:59:50Z")

</div>

yes I did it and I run my action also but not work

---

<div class="post-metadata">

**Author:** ![gcgloven](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/gcgloven/32/3915_2.png) [@gcgloven](https://forum.rasa.com/u/gcgloven)\
**Post date:** [June 25, 2019, 1:52am UTC](https://forum.rasa.com/t/issue-rasa-check-or-statement/11947/4 "2019-06-25T01:52:02Z")

</div>

Could you give screenshot of your whole action file and also the method latest\_message.text. I am not that skilled with rasa also but to access the latest message let’s say data={…} contains the tracker json readings, You could access the latest message with **data[“tracker”][“latest\_message”][“text”]**

Also, you can run “ **rasa run actions -vv** ” to enter debug mode, then you can post your debug log here for us to view.

---

<div class="post-metadata">

**Author:** ![hajoura](https://avatars.discourse-cdn.com/v4/letter/h/5f8ce5/32.png) [@hajoura](https://forum.rasa.com/u/hajoura)\
**Post date:** [June 25, 2019, 3:56am UTC](https://forum.rasa.com/t/issue-rasa-check-or-statement/11947/5 "2019-06-25T03:56:30Z")

</div>

thank you so much you help too much I wish for you best day thx

---

<div class="post-metadata">

**Author:** ![gcgloven](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/gcgloven/32/3915_2.png) [@gcgloven](https://forum.rasa.com/u/gcgloven)\
**Post date:** [June 25, 2019, 4:30am UTC](https://forum.rasa.com/t/issue-rasa-check-or-statement/11947/6 "2019-06-25T04:30:02Z")

</div>

you can use

tracker.latest\_message[“text”] instead of tracker.latest\_message.text[“text”] I tried this and it works fine
