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

Dialogflow CX -- System Function in Custom Payload

Hi there!

I am using Dialogflow CX to create a conversational agent.

I have connected to a DataStore (CSV with some columns), and the chatbot easily recognises the response for each question stored in the CSV.

I saw in a previous topic of this forum that you can use a system function to dynamically retrieve the URL associated to each question (another column in the CSV), and the link is provided to the user with the response. The function is  $sys.func.GET_FIELD($sys.func.GET($request.knowledge.sources[0], 0), "uri")

I would like to insert that dynamic link in a custom payload to give some format to the given URL, something like this:

{
"richContent": [
    [
        {
            "type": "button",
            "text": "Learn More",
            "link": "$sys.func.GET_FIELD($sys.func.GET($request.knowledge.sources[0], 0), 'uri')"
        }
    ]
                            ]
}

This is not working, the link is not recognised (retrieves null), and i would prefer not to develop a Webhook;

Do you guys know any workaround to achieve a system function recognizable in a Custom Payload or the Webhook is the only way to embellish a dynamic link in DialogFlow??

0 3 447
3 REPLIES 3

Hi @Raunix could you please share the URL when these system functions where discussed?

Hi @Mizar 

This is the thread where i heard for the first time about the possibility of using a system fucntion: https://www.googlecloudcommunity.com/gc/AI-ML/DialogFlow-CX-Data-stores-with-custom-payload/m-p/6994...

This is the Google documentation page where system functions are discussed: https://cloud.google.com/dialogflow/cx/docs/reference/system-functions#func-get

After some research i believe that without designing a Webhook is not possible to insert a system function (Ej. A dynamic link in my case) into a Custom Payload response.

Another simpler option is to just sacrifice the personalization provided by the Custom Payload and just insert the function system as a text response type. This allows you to retrieve a dynamic link in the Chatbot with a decent visual components and with 0 extra time consumed in the Webhook design. It was enough for my project:

Raunix_0-1726482140795.png

 

@Raunix Well you defined cleary, I hope I wasn't the guy who said it, some people get mad.

The docs are clear, and there are some functions that are better to be called from code into a webhook to design a complex chatbot like this.

I do recommend you try to do it from code, you'll find that it is easier to maintain and escalate.