Access value from the database

Hi…

how can we use this in conversational Studio UI as shown in the query above? any doc or guide on this.
my output show [object object]

1 Like

Hey @izuan.yusop
First, you need to store the result of a database search in an object variable. Now, in the Text message node, you can access it with this syntax {{variables.db_result.0.column_name}}

Here the column name is the same column name in the database. I hope this helps!

1 Like

Hi Pratik,

how about db_result? is it a default? or is it represent table or variable name.
{{variables.db_result.0.os_custid}}

1 Like

@izuan.yusop here db_result is a variable in which you’re storing the database search result.
0 is the index value and column_name is the column name of the table on which you’re trying to run a search query.

1 Like

image
Hii @Pratik As you can see I have used the same format as you mentioned but I am not getting the value displayed in the response. I have even used the same with 3 pairs of curly braces however the response remains the same. The part containing the value is always omitted.

1 Like

Hi Pratik,

Thanks for your reply.
As per your instruction, still unable to display the output from the database created.

below is to explain what I try to achieve.
-key in serial number
-match with database
-if success, to display cust info

appreciate your reply. thank you very much

3 Likes

Can you please share bot access with me at pratik@yellow.ai?

Hey @izuan.yusop
It’s been fixed now. It was my bad, correct syntax to access values from database is {{{variables.db_response.records.0.column_name}}}

Hi Pratik,

Now it works. thank you very much for your support


result2

1 Like

A post was split to a new topic: Search the database if email already exists