Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Dialogflow CX is there a way to iterate a parameter?

Hello,

Is there a way to iterate an array that you have in paremeter. For example I have an array = [ { "rate_float": 29735.3307, "symbol": "$", "description": "United States Dollar", "rate": "29,735.3307", "code": "USD" }, { "rate_float": 29735.3307, "symbol": "$", "description": "United States Dollar", "rate": "29,735.3307", "code": "USD" } ] in a parameter called test. 

In the agent response I would put $session.params.test[0] to get the first one, but for example I want to iterate and make a response like a list, how should I approach this? With a custom payload?

2 4 1,290
4 REPLIES 4

Hi!

You can use the JOIN function to achieve that: https://cloud.google.com/dialogflow/cx/docs/reference/system-functions

Xavi

Hello, thanks for the answer. But it's not what I am looking for.

I am looking for a way to reply with a list in dialogflow, for example for botcopy there is a way to send a list using custom payload, but how do I iterate a variable that have an array in it. Can I do a for loop inside it? 

Is there someone who knows this? 

Have you found any solution for this? I've been looking for something similar but with no success.