07-07-2025 06:59 PM
Hi,
I'm retreiving sign in logs from MS graph via HTTP. The schema is complex and seems to change a lot so I've had issues trying to define a proper schema for data pills.
I would really just like to access one of the high level json objects and be able to use it as data I would save to a file or pass to a snowflake field.
e.g. in python I would just use
response.json()['value']
is this possible?
07-07-2025 08:45 PM
Add the payload data pill to a logger or variable or wherever, set it to formula mode, and do response["value"]
If your "response" data pill looks like this:
{
"test1": "one",
"test2": "two",
"test3": [ 1, 2, 3 ],
"test4": [ {"test5": "five"} ],
"test6": { "test7": "seven" }
}
Then this follows:
And so on...
07-07-2025 09:03 PM
Hello, @rm135 ,
you can do that by keeping the response format as TEXT in your HTTP step. That way, you don't need to define any schema or worry about data pills.
But since the response will be treated as a raw JSON string, you'll need to use a code step (Ruby, Python, or JavaScript) to parse that string and extract the part you need
Hope this helps! Let me know if I missed your question or if you need something different.
07-12-2025 07:34 PM
I would use the part of the schema that is stable, Workato is pretty forgiving in terms of the Json 👌.
You can
By doing that you get the data pills for the fields that are set/standard across the logs. You can then run whatever logic you want with that. ✅
You will not get data pills for the parts you took out of the schema (or anything new that shows up), which is fine since you will be passing the log elsewhere. In case you only need to pass a part of the JSON - that can be done just like @gary1 suggested with formula mode to extract what you need and passing that through.
That said, I would avoid trying to manually parse the JSON as a text ⛔ - you loose the benefits of the data pills and create tech debt. It also takes more time to setup and maintain. So, avoid these headaches and use the standard schema that you need (not the whole schema). Only pars/extract things if you have a specific requirement/need to pass part of the log.
Let me know how it goes.
Cheers!
07-13-2025 02:53 AM
Hello @platovandre
Thanks for the input. That said, in scenarios where the schema is unstable or frequently changing, working with the raw JSON as text and handling it in a code step (Python/JS) is actually much more flexible — not really a headache if you're comfortable with basic scripting.
Also, regarding data pills — if needed, we can define a custom output schema in the code step’s output fields, so pill generation can be fully controlled without relying on upstream schema stability.
This approach gives more control and avoids unnecessary complications when the structure isn’t consistent.