Genesys Data Action Output Contract Recognizes dot as underscores

Hi

I have a raw data action output from which I need the element "rows.f.v". When writing this into the output contract, I'll get an empty result in this field, as "rows.f.v" translates to "rows__f__v" for some reason (see screenshots below.

Question. How do I make genesys output contract recognize names with dots included?
Best
Lukas



Full resulting JSON

{
"schema.fields.name": [
"user_id",
"number",
"first_name",
"last_name",
"org_unit",
"location",
"email"
],
"kind": "bigquery#queryResponse",
"schema.fields.type": [
"STRING",
"STRING",
"STRING",
"STRING",
"STRING",
"STRING",
"STRING"
],
"cacheHit": true,
"schema.fields.mode": [
"NULLABLE",
"NULLABLE",
"NULLABLE",
"NULLABLE",
"NULLABLE",
"NULLABLE",
"NULLABLE"
],
"jobReference.projectId": "rpts-analytics",
"jobComplete": true,
"totalRows": "1",
"jobReference.jobId": "job_-zP2Yn3hEMOYCezXcIbZiP9wGh1o",
"rows.f.v": [
[
"u00005877",
"+41XXX",
"Lukas",
"Weixler",
"741",
"50.0",
"None"
]
],
"jobReference.location": "europe-west3",
"totalBytesProcessed": "0",
"rows__f__v": [
null
]
}

Hi CWebkas,

Can you provide the raw response from the endpoint, redacting anything private. The key part is that we get to see the keys and the shape of the data. You can get this from either the "Execute" step in test mode, or if you turn off the flattening box the test output should also be exactly what you got back.

--Jason

Hi Jason,

Here is the redacted json raw response from the endpoint. I want to get the data within "rows.f.v".
Thx ahead.
Lukas

{
"schema.fields.name": [
"user_id",
"number",
"first_name",
"last_name",
"org_unit",
"location",
"email"
],
"kind": "bigquery#queryResponse",
"schema.fields.type": [
"STRING",
"STRING",
"STRING",
"STRING",
"STRING",
"STRING",
"STRING"
],
"cacheHit": true,
"schema.fields.mode": [
"NULLABLE",
"NULLABLE",
"NULLABLE",
"NULLABLE",
"NULLABLE",
"NULLABLE",
"NULLABLE"
],
"jobReference.projectId": "rpts-analytics",
"jobComplete": true,
"totalRows": "1",
"jobReference.jobId": "job_-zP2Yn3hEMOYCezXcIbZiP9wGh1o",
"rows.f.v": [
[
"u00005877",
"+XXXXX",
"XXXXX",
"XXXXX",
"741",
"50.0",
"None"
]
],
"jobReference.location": "europe-west3",
"totalBytesProcessed": "0",
"rows__f__v": [
null
]
}

Hi CWebkas,

The output that you just provided is definitely still being flattened. Can you either uncheck the "flatten ouput" checkbox or get the output from the execute step of test mode?

--Jason

Hi Jason,

Thx, of course. Here is the un-flattened output. Thx ahead.

{
"kind": "bigquery#queryResponse",
"schema": {
"fields": [
{
"name": "user_id",
"type": "STRING",
"mode": "NULLABLE"
},
{
"name": "number",
"type": "STRING",
"mode": "NULLABLE"
},
{
"name": "first_name",
"type": "STRING",
"mode": "NULLABLE"
},
{
"name": "last_name",
"type": "STRING",
"mode": "NULLABLE"
},
{
"name": "org_unit",
"type": "STRING",
"mode": "NULLABLE"
},
{
"name": "location",
"type": "STRING",
"mode": "NULLABLE"
},
{
"name": "email",
"type": "STRING",
"mode": "NULLABLE"
}
]
},
"jobReference": {
"projectId": "rpts-analytics",
"jobId": "job_JuE5OmH47W5g4fUlYK_fpZpUO9Fq",
"location": "europe-west3"
},
"totalRows": "1",
"rows": [
{
"f": [
{
"v": "xxxxxxxx"
},
{
"v": "+xxxxxxxxxx"
},
{
"v": "xxxxxxxxx"
},
{
"v": "xxxxxxx"
},
{
"v": "xxxxx"
},
{
"v": "xxxxxxx"
},
{
"v": "xxxxxxxxx"
}
]
}
],
"totalBytesProcessed": "0",
"jobComplete": true,
"cacheHit": true
}

Thanks for that output, now we can work through your issues.

It looks like you tried to create your output contract based on the flattened output that you were seeing. That isn't how you want to do it. If you are trying to output the raw result from that endpoint then you would need to create an output contract that looks like the output.

Unfortunately, if you do that with this output, you will have an array within an array, which will fail when we attempt to flatten it. So here is an outline of the approach to try:

Grab the "f" array from the first result in the "rows" array:

{
  "translationMap": {
    "f-values" : "rows[0].f"
  },
  "translationMapDefaults": {
  },
  "successTemplate": "{ \"f-values\": $f-values}"
}

Then your output contract can look like this:

{
  "type": "object",
  "properties": {
    "f-values": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "v": {
            "type": "string"
          }
        },
        "additionalProperties": true
      }
    }
  }, 
 "additionalProperties": true
}

You may need to alter what you pull out of your results, but hopefully this will get you going.

--Jason

Success! Thank you very much for your help. To now access the single values, I modified the output contract and the response config as follows:

Output Contract:

{
  "type": "object",
   "properties": {
    "userID": {
      "type": "object",
         "properties": {
            "v": {
                "type": "string"
    }
  },
  "additionalProperties": true
},
"firstname": {
  "type": "object",
  "properties": {
    "v": {
      "type": "string"
    }
  },
  "additionalProperties": true
},
"lastname": {
  "type": "object",
  "properties": {
    "v": {
      "type": "string"
    }
  },
  "additionalProperties": true
},
"number": {
  "type": "object",
  "properties": {
       "v": {
        "type": "string"
       }
     },
     "additionalProperties": true
     },
"location": {
  "type": "object",
  "properties": {
    "v": {
      "type": "string"
    }
  },
    "additionalProperties": true
    }
   },
   "additionalProperties": true
 }

Response Config:

{
"translationMap": {
"number": "rows[0].f[1]",
"firstname": "rows[0].f[2]",
"location": "rows[0].f[4]",
"userID": "rows[0].f[0]",
"lastname": "rows[0].f[3]"
 },
"translationMapDefaults": {},
"successTemplate": "{ \"userID\": $userID, \"number\": $number, \"firstname\": $firstname, \"lastname\": 
$lastname,\"location\": $location}"
}

Glad we could help you get this working!

--Jason

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.