web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Best Way to Handle Var...
Power Automate
Answered

Best Way to Handle Variable JSON Formatting When Parsing

(0) ShareShare
ReportReport
Posted on by 124

I've been working on a flow that will retrieve FedEx API data. The flow is pretty straightforward, taking a tracking number from a canvas app, calling the API, and then returning the formatted JSON to the app for display. I'm having issues as the FedEx return is not constant: some of the nodes vary between an array or an object. I've tried setting up failover by configuring Run After with different JSON samples that I've received, but the API continues to come up with new structures (current iteration allows for 3 different JSON results). 

eauerbach_0-1635277383377.png

 

What's the best way to handle an API result that can provide different structures for the same call?

 

Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @eauerbach 

     

    This is not a flow issue. The schema validation for that JSON you have used can only validate based on you have provided. I would recommend to look the API documentation and see the full sample dataset and generate the schema. Also remove the mandatory schema validations once the object is generated so that it could handle all the scenarios.

     

    Thanks

  • emauerbach Profile Picture
    124 on at

    Thanks @abm . How do I disable mandatory validation? 

  • Verified answer
    abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @eauerbach 

     

    Look at the schema and manually delete those nodes where it says mandatory from the JSON or set to accept null for those properties which are complaining about.

     

    "Age": {
    "type": ["number","null"]
    },
    "Name": {
    "type": ["string","null"]
    },

     

     

  • emauerbach Profile Picture
    124 on at

    Thank you @abm ! Works great now.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard