Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
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?

 

  • emauerbach Profile Picture
    124 on at
    Re: Best Way to Handle Variable JSON Formatting When Parsing

    Thank you @abm ! Works great now.

  • Verified answer
    abm abm Profile Picture
    32,506 Most Valuable Professional on at
    Re: Best Way to Handle Variable JSON Formatting When Parsing

    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
    Re: Best Way to Handle Variable JSON Formatting When Parsing

    Thanks @abm . How do I disable mandatory validation? 

  • abm abm Profile Picture
    32,506 Most Valuable Professional on at
    Re: Best Way to Handle Variable JSON Formatting When Parsing

    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

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1