Calling custom attributes in a new node

Hey all,

I am building a bot for a restaurant and take orders. I made it so the bot stores the orders in a custom attribute but I can’t seem to be able to call it in a different node when confirming the order. Example the user chooses to order “Hawaiian Pizza” and the bot you then answer: “Perfect, you’ve order a Hawaiian Pizza, it will be: $15”

How should I go about this?


Here is an example that shows how to do this (under Repeat what a user says in a chatbot response):

As shown in the example, you have to call a function to do this. Assume that your attribute name is “user-order”.

If you are doing this inside the GUI, enter the following in a text message bubble:

Just to confirm your order (get-user-attribute-as-string "user-order")

Note that you need to use the back quotes to quote the function call as shown inside the screenshot in the link above. We are working on GUIfy this so others just need to click on the attribute without calling the function.

If you are doing this inside IDE, you will just call the function as follows with no quotes:

[some user input pattern]
[“Just to confirm your order” (get-user-attribute-as-string “user-order”)]

Thanks Michelle!

So it the help docs it shows you how to do it from an acknowledgement in the same “node” but is it possible to recall this from a different node altogether later during the flow?

Hi @MarcLorrain

Yes, you can use it in any later nodes as long as you have it stored.

For example, you have an value stored as a system attribute or a custom attribute by the name “user-order”. You can later use the method @mzhou described above to retrieve that value in chat. e.g., (get-user-attribute-as-string "user-order")

1 Like