Re: How to programatically pass value of @sys.geo-country-code system entity to DialogFlow?

74 views
Skip to first unread message
Message has been deleted

Jinjun Q

unread,
Feb 12, 2021, 4:41:28 PM2/12/21
to Dialogflow Essentials Edition users

Hello,

Google Groups are for general discussion. For specific coding issues, please ask on Stackoverflow.com with your sample code, expected and actual behavior for help.



On Thursday, February 4, 2021 at 12:08:14 PM UTC-5 pallav...@gmail.com wrote:

I have a DialogFlow agent that I call using intents from my Flutter code. In my desired intent, I have fulfillment enabled to call my Node.js backend.

In my intent, I have a country_code parameter of the system entity type @sys.geo-country-code.

I trigger this intent in Flutter using an event and pass the required parameters. Here is the line of code in Flutter:

var parameters = "'parameters' : {'country_code': '$countryCode'}";

and here is a sample request for the parameters:

"parameters": { 
   "country_code": "US"
}

I expect that when this request reaches DialogFlow, it transforms the country_code input to an object that looks something like this:

   "alpha-2":"US",
   "alpha-3":"USA",
   "name":"United States of America",
   "numeric":840
}

However, when the fullfillment request reaches my Node.js backend, I see that DialogFlow is not transforming the input country_code to this object. Rather, the fulfillment request is done with the same input as I provided to DialogFlow. When I do the same thing with the DialogFlow console, it works perfectly. So, it seems that something is not correct in the way I call the DialogFlow API from Flutter. However, I can't say what.

Can someone please help?

Reply all
Reply to author
Forward
0 new messages