# I want to see a picture of a character named IronMan

**URL:** <https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015>\
**Category:** Rasa Open Source\
**Created:** [July 22, 2021, 8:59am UTC](https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015 "2021-07-22T08:59:25Z")\
**Posts on this page:** 20\
**Page:** 2

<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:** [August 3, 2021, 11:46pm UTC](https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015/21 "2021-08-03T23:46:11Z")

</div>

@longnguyenQB Don’t be sad please. Share code like action file for blackwidow, or age where you wrote the code.

```
`dispacture.utter_message(template= "utter_ (what ever you mention in response)`")
return [] 

```

OR

```
responses:
utter_(whatever you mention):
 - text: Her is your answer Name: {name} and its Age: {age}
```

---

<div class="post-metadata">

**Author:** ![longnguyenQB](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/longnguyenqb/32/16113_2.png) [@longnguyenQB](https://forum.rasa.com/u/longnguyenQB)\
**Post date:** [August 3, 2021, 11:48pm UTC](https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015/22 "2021-08-03T23:48:33Z")

</div>

> [@nik202](#):
>
> Don’t be sad please. Share code like action file for blackwidow, or age where you wrote the code.

@nik202 I have shared here, this is an example for you to understand, my database is not like this

---

<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:** [August 3, 2021, 11:51pm UTC](https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015/24 "2021-08-03T23:51:01Z")

</div>

@longnguyenQB Its very hard for me to understand, but I mention in my above post, hope you understand.

---

<div class="post-metadata">

**Author:** ![longnguyenQB](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/longnguyenqb/32/16113_2.png) [@longnguyenQB](https://forum.rasa.com/u/longnguyenQB)\
**Post date:** [August 3, 2021, 11:53pm UTC](https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015/25 "2021-08-03T23:53:37Z")

</div>

class ActionSearchDocument(Action):

```
def name(self) -> Text:
    return "action_search_document"

def run(self, dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

    document_name = tracker.get_slot("document_name")
    query_begin = "SELECT name FROM document"
    mycursor.execute(query_begin)
    result_query_begin = mycursor.fetchall()

     # write query
   query_end = "SELECT name, link, date FROM document WHERE name = '" + result_match + "'"

    mycursor.execute(query_end)
    myresult = mycursor.fetchall()
    dispatcher.utter_message(text=f"This is document you want: ")
            dispatcher.utter_message(myresult)

    return []

```

result : [[“Scientist for beginer”, “[https://drive.google.com/file/d/1V2XS\_2pY1yJjDZLJb-P-KoD9UU18N3wF/view?usp=sharing](https://drive.google.com/file/d/1V2XS_2pY1yJjDZLJb-P-KoD9UU18N3wF/view?usp=sharing)”, “2021-07-27 00:00:00”]]

1. i want my result look like : name : Scientist for beginer , link : [https://drive.google.com/file/d/1V2XS\_2pY1yJjDZLJb-P-KoD9UU18N3wF/view?usp=sharing](https://drive.google.com/file/d/1V2XS_2pY1yJjDZLJb-P-KoD9UU18N3wF/view?usp=sharing) , date : 2021-07-27 00:00:00@nik202

---

<div class="post-metadata">

**Author:** ![longnguyenQB](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/longnguyenqb/32/16113_2.png) [@longnguyenQB](https://forum.rasa.com/u/longnguyenQB)\
**Post date:** [August 3, 2021, 11:56pm UTC](https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015/26 "2021-08-03T23:56:41Z")

</div>

@nik202 this is my code

---

<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:** [August 3, 2021, 11:58pm UTC](https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015/27 "2021-08-03T23:58:51Z")

</div>

> [@longnguyenQB](#):
>
> `dispatcher.utter_message(myresult)`

@longnguyenQB I know only English 😛@longnguyenQB the google drive link I can’t understand sorry.

@longnguyenQB In my result the values are name, link and date?

@longnguyenQB After this `myresult = mycursor.fetchall()` check the output value while using `print(myresult)` check what values it return.

@longnguyenQB try this

```
dispatcher.utter_message(text=f"This is document you want: {name}, {link}, {date} ", tracker=tracker)

```

OR

`dispatcher.utter_message(myresult)`

---

<div class="post-metadata">

**Author:** ![longnguyenQB](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/longnguyenqb/32/16113_2.png) [@longnguyenQB](https://forum.rasa.com/u/longnguyenQB)\
**Post date:** [August 3, 2021, 11:59pm UTC](https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015/28 "2021-08-03T23:59:54Z")

</div>

@nik202 yes,

1. result : [[“Scientist for beginer”, “[https://drive.google.com/file/d/1V2XS\_2pY1yJjDZLJb-P-KoD9UU18N3wF/view?usp=sharing”](https://drive.google.com/file/d/1V2XS_2pY1yJjDZLJb-P-KoD9UU18N3wF/view?usp=sharing%E2%80%9D), “2021-07-27 00:00:00”]]

2. but i want my result look like : name : Scientist for beginer , link : [https://drive.google.com/file/d/1V2XS\_2pY1yJjDZLJb-P-KoD9UU18N3wF/view?usp=sharing](https://drive.google.com/file/d/1V2XS_2pY1yJjDZLJb-P-KoD9UU18N3wF/view?usp=sharing) , date : 2021-07-27 00:00:00 @nik202

---

<div class="post-metadata">

**Author:** ![longnguyenQB](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/longnguyenqb/32/16113_2.png) [@longnguyenQB](https://forum.rasa.com/u/longnguyenQB)\
**Post date:** [August 4, 2021, 12:03am UTC](https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015/29 "2021-08-04T00:03:40Z")

</div>

> [@nik202](#):
>
> `tracker`

@nik202 what is tracker???

---

<div class="post-metadata">

**Author:** ![longnguyenQB](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/longnguyenqb/32/16113_2.png) [@longnguyenQB](https://forum.rasa.com/u/longnguyenQB)\
**Post date:** [August 4, 2021, 12:06am UTC](https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015/30 "2021-08-04T00:06:37Z")

</div>

if i code : dispatcher.utter\_message(myresult)

1. result : [[“Scientist for beginer”, “[https://drive.google.com/file/d/1V2XS\_2pY1yJjDZLJb-P-KoD9UU18N3wF/view?usp=sharing”](https://drive.google.com/file/d/1V2XS_2pY1yJjDZLJb-P-KoD9UU18N3wF/view?usp=sharing%E2%80%9D) , “2021-07-27 00:00:00”]]
2. but i want my result look like : name : Scientist for beginer , link : [https://drive.google.com/file/d/1V2XS\_2pY1yJjDZLJb-P-KoD9UU18N3wF/view?usp=sharing](https://drive.google.com/file/d/1V2XS_2pY1yJjDZLJb-P-KoD9UU18N3wF/view?usp=sharing) , date : 2021-07-27 00:00:00 @nik202

---

<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:** [August 4, 2021, 12:07am UTC](https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015/31 "2021-08-04T00:07:11Z")

</div>

@longnguyenQB The `Tracker` class represents a Rasa conversation tracker. It lets you access your bot’s memory in your custom actions. You can get information about past events and the current state of the conversation through `Tracker` attributes and methods you wrote in `def run`

---

<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:** [August 4, 2021, 12:08am UTC](https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015/32 "2021-08-04T00:08:04Z")

</div>

@longnguyenQB This pdf is 21 page, what you sharing I can’t get sorry. @longnguyenQB try what I suggested.

---

<div class="post-metadata">

**Author:** ![longnguyenQB](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/longnguyenqb/32/16113_2.png) [@longnguyenQB](https://forum.rasa.com/u/longnguyenQB)\
**Post date:** [August 4, 2021, 12:08am UTC](https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015/33 "2021-08-04T00:08:58Z")

</div>

> [@nik202](#):
>
> This pdf is 21 page, what you sharing I can’t get sorry

it’s just a link, don’t mind it!

---

<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:** [August 4, 2021, 12:10am UTC](https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015/34 "2021-08-04T00:10:52Z")

</div>

@longnguyenQB Then, why you sharing, it not make any sense to me or related to code, you just want to show name, link and age that’s it. rather just share the output, please delete that links, it make other confuse.

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [August 4, 2021, 7:18am UTC](https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015/35 "2021-08-04T07:18:24Z")

</div>

> [@nik202](#):
>
> Then, why you sharing, it not make any sense to me or related to code, you just want to show name, link and age that’s it. rather just share the output, please delete that links, it make other confuse.

@nik202 The link is just part of the output

* * *

* * *

> [@longnguyenQB](#):
>
> if i code : dispatcher.utter\_message(myresult)
> 
> 1. result:
> 
> ```auto
> [["Scientist for beginer", "https://drive.google.com/file/d/1V2XS_2pY1yJjDZLJb-P-KoD9UU18N3wF/view?usp=sharing", "2021-07-27 00:00:00"]]
> 
> ```
> 
> 1. but i want my result look like:
> 
> ```auto
> name : Scientist for beginer, link : https://drive.google.com/file/d/1V2XS_2pY1yJjDZLJb-P-KoD9UU18N3wF/view?usp=sharing, date : 2021-07-27 00:00:00
> 
> ```

The result you’re getting is a list of a single list.

```auto
myresult = [["Scientist for beginer", "https://drive.google.com/file/d/1V2XS_2pY1yJjDZLJb-P-KoD9UU18N3wF/view?usp=sharing", "2021-07-27 00:00:00"]]
myresult[0] = ["Scientist for beginer", "https://drive.google.com/file/d/1V2XS_2pY1yJjDZLJb-P-KoD9UU18N3wF/view?usp=sharing", "2021-07-27 00:00:00"]

myresult[0][0] = "Scientist for beginer"
myresult[0][1] = "https://drive.google.com/file/d/1V2XS_2pY1yJjDZLJb-P-KoD9UU18N3wF/view?usp=sharing"
myresult[0][2] = "2021-07-27 00:00:00"

```

So just do this:

```auto
myresult = mycursor.fetchall()
message = "name: " + myresult[0][0] + ", link: " + myresult[0][1] + ", date: " + myresult[0][2]

dispatcher.utter_message()
dispatcher.utter_message(myresult)

```

This is just simple regular Python code, it is not related to Rasa.

Hope this helps!

---

<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:** [August 4, 2021, 7:52am UTC](https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015/36 "2021-08-04T07:52:51Z")

</div>

Ohhhhhhhh right, Chris 🧐 🧐

@longnguyenQB Please follow Chris advice, it makes a lot of sense if you are expecting the Result which you had shown, and sorry for the confusion, I was expecting BlackWidow and Loki as a result, but by the way are you sure Blackwidow is age 40? 😛

Good Luck!

---

<div class="post-metadata">

**Author:** ![longnguyenQB](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/longnguyenqb/32/16113_2.png) [@longnguyenQB](https://forum.rasa.com/u/longnguyenQB)\
**Post date:** [August 5, 2021, 9:29pm UTC](https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015/37 "2021-08-05T21:29:34Z")

</div>

@ChrisRahme Thank you so much, this is exactly what I needed!

---

<div class="post-metadata">

**Author:** ![longnguyenQB](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/longnguyenqb/32/16113_2.png) [@longnguyenQB](https://forum.rasa.com/u/longnguyenQB)\
**Post date:** [August 5, 2021, 9:30pm UTC](https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015/38 "2021-08-05T21:30:15Z")

</div>

@nik202 Thank you very much, you have been very helpful to me!

---

<div class="post-metadata">

**Author:** ![longnguyenQB](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/longnguyenqb/32/16113_2.png) [@longnguyenQB](https://forum.rasa.com/u/longnguyenQB)\
**Post date:** [August 5, 2021, 9:37pm UTC](https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015/39 "2021-08-05T21:37:33Z")

</div>

@nik202

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/8/8/882bb3db5372620fc5789635fc5c9cf7d2808709.png)

> I have 1 last problem, hope everyone can help me in this post. when I run rasa shell, input : “tìm kiếm tài liệu đề thi tháng 4” (It’s a request in Vietnamese, translated into English as: searching for April exam papers)

> output : “Đấy là thông tin tài liệu đề thi tháng 4:” (translated into English as: This is the April exam paper). The problem here is that the result returned from my database query is a string that is not utf-8. How to fix this last problem? I’m so grateful!

---

<div class="post-metadata">

**Author:** ![longnguyenQB](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/longnguyenqb/32/16113_2.png) [@longnguyenQB](https://forum.rasa.com/u/longnguyenQB)\
**Post date:** [August 5, 2021, 9:40pm UTC](https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015/40 "2021-08-05T21:40:24Z")

</div>

@ChrisRahme the result that I expect from the database query is " Tài liệu đề thi tháng 4" (April exam papers) But the actual result is:"\u0111\u1ec1 thi th\u00e1ng 4"

---

<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:** [August 5, 2021, 9:42pm UTC](https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015/41 "2021-08-05T21:42:30Z")

</div>

@longnguyenQB Its encoding UTF-8 issue, try share the code where you fetching .csv file

[Previous page](https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015.md?page=1)

[Next page](https://forum.rasa.com/t/i-want-to-see-a-picture-of-a-character-named-ironman/46015.md?page=3)
