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 / PowerAutomate - JSON S...
Power Automate
Unanswered

PowerAutomate - JSON Schema

(0) ShareShare
ReportReport
Posted on by 2

I'm using PowerAutomate to query an API. It successfully returns a JSON which is an array of objects. Im struggling to run an 'apply to each' against the results and i think it is due to the JSON schema i am using to parse the json response body. The apply to each doesnt seem to be able to distinguish the different objects inside the array. Does anyone have any experience of that, and could offer some suggestions?

Categories:
I have the same question (0)
  • sudharsan1985 Profile Picture
    1,325 on at

    Hi @titlerequired 

    Try to use the action Parse JSON with some sample JSON data, which will create a schema based on the sample data. Also, to better understand the issue, please post some screenshots.

  • titlerequired Profile Picture
    2 on at

    Thanks for the reply.

     

    I have been trying to create a schema based on the response data (which i have done in previous steps) but i dont really understand the structure of how the schema should be.

     

    The response body might contain several devices, or many devices, each with 00s of properties but i really only want 5 or 6 of them.

     

    1 of the properties may or may not exist.

     

    If someone could help me to make a schema to only capture or pass certain properties through that would be really helpful.

     

    This was a schema i tried a few attempts back,

     

    {
     "type": "object",
     "items": {
     "type": "array",
     "properties": {
     "_id": {
     "type": "string"
     },
     "ip": {
     "type": "string"
     },
     "mac": {
     "type": "string"
     },
     "model": {
     "type": "string"
     },
     "type": {
     "type": "string"
     },
     "version": {
     "type": "string"
     }
     },
     "required": [
     "_id",
     "ip",
     "mac",
     "model",
     "type",
     "version"
     ]
     }
    }

     

    And the response,

    power1.png

  • sudharsan1985 Profile Picture
    1,325 on at

    Hi @titlerequired 

    Your requirement is obscure to me. But the error is due to the direct access of the object, and you shouldn't send the object instead try to add it to an array and send the array, it should work.

     

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 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard