cancel
Showing results for 
Search instead for 
Did you mean: 

Processing OData Responses

darren-davies
Deputy Chef I
Deputy Chef I

Hi All,

I'm trying to process an odata response from an external system.  The response has odata attributes that are needed, but are coming through as null when mapped in the HTTP response schema.  The entries within the "value" list correctly map, it's only the odata attributes that are missing.

The response has the structure:

{
"@odata.context": "serviceRoot/$metadata#People",
"value": [ ...... ],
"@odata.nextLink": "serviceRoot/People?%24skiptoken=8"
}

The @odata.nextLink is the value that is needed.

The ResponseSchema maps the "@odata" to "_odata" and flags errors when editing the field in the UI.  Editing the JSON schema appears to work.

Has anyone successfully pulled odata attributes and has any pointers as to where I could be going wrong?

Thanks,

Darren.

 

 

5 REPLIES 5

steven-marissen
Executive Chef I
Executive Chef I

Is it an idea to:

  1. Map the entire api response to a variable (in formula mode)
  2. Use gsub to find en replace @ symbols with nothing
  3. Use JSON parser by Workato that has the variable as document and as sample document an example without @'s
  4. From there you should be able to get values out again

I know it's a hassle and not much better than replacing @symbols in schemas with _ but another approach nonetheless 🙂