Google API JSON: Can't get specific isolated values

I am working with Google’s DialogFlow API for building an ChatBot with OpenAI GPT. Basically when the conversation can’t be handled by DialogFlow it will pass the message to OpenAI GPT API so the bot can always respond something relevant.

Process:

  1. I created a new API Workflow with POST inputs. Twilio will send al incoming messages to this endpoint.

  2. The POST inputs are send to DialogFlow and DialogFlow will either find a match for the conversation or not. Either way DialogFlow responds to the API call made by Wappler with the following schema:

    {
    “responseId”: “db31e6f8-328f-479f-8d80-621585e9a47d-18dedd3b”,
    “queryResult”: {
    “queryText”: “hola”,
    “action”: “input.welcome”,
    “parameters”: {},
    “allRequiredParamsPresent”: true,
    “fulfillmentText”: “¡Hola!”,
    “fulfillmentMessages”: [
    {
    “text”: {
    “text”: [
    “¡Hola!”
    ]
    }
    }
    ],
    “intent”: {
    “name”: “projects/telefonia-di9o/agent/intents/9bc3d7b9-bb9e-41eb-a3e6-edb3548251fa”,
    “displayName”: “Default Welcome Intent”
    },
    “intentDetectionConfidence”: 1,
    “languageCode”: “es”
    }
    }

As you can se there is an action inside the queryResult object which I will use to determine the next step. Also there is an array called fulfillmentMessages which contain text value that I would like to get and use for further steps.

The problem is that I am not able to access those values. The only way I have been able to get info to a next step is by getting the full response (see attachments).


I have read Server Action Unpacking Nested API JSON results , Is this a bug? Api action json data, i cant format correctly the values of an array and of course the API Connector Docs but can’t isolate the values I want

Hi,

Are you maybe saying you can’t select those values because they don’t appear in the Data Binding Picker window? You can still access them manually through the code edit mode in such window, or you can manually define the schema in the API Action step so those JSON properties appear when you attempt to select them

Sorry I was not clear enough and thank you for your time @Apple

I can select the values in the Data Binding Picker window but if I select anything they will return empty.
The only value I can select that comes with a value not empyt is the whole data (sendToDialogflow.data) but it will store the whole json :frowning:

If I try to select something else it will return empty (and somehow is also orange color while data is blue)

Decided to give a try to ChatGPT abou this wappler issue, this was my bad prompt:

Using the tool Wappler, I created an Server side API action that call a Google API and gets a Json in response. I will provide a JSON response in the next message, but it is a nested JSON and I am not able to extract specific values from the json response to use them in the next action in wappler server workflow. I can only get the full json but if I try to select a specific value then I get an empty value. Tell me what I am doing wrong and how to fix it. Being the desired success to be able to select a single value in the json response that is inside the nested json.

and in the next message I provided a sample of the JSON. Soon enough ChatGPT gave a solution that worked:

Now its working.

1 Like

Well, unfortunately, we don’t have a screenshot of one of your previous Set Value attempt(s) to see what went wrong/to compare. Glad you managed to solve it though! :slight_smile:

1 Like