cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PikaPika
Frequent Visitor

Parse JSON - Why does it not follow the Schema? It adds in things that are not part of the schema, so whats the point?

This issue isn't specific to any one given Parse JSON schema but everyone I use.

My goal is sometimes I only want part of the Schema to be populated so in the Parse JSON I actually very specifically create a schema that has only certain parts. But no matter what, Parse JSON still adds in the stuff I don't want and in some cases it adds a huge amount of extra work to get rid of it, if i can at all.

 

in the example below all I want is the value, I do not want, the id at all, so my schema is set to only even mention that value field, yet the id field shows up in output

 

There truly seems no reason to put in a schema, when as far as I know, I cannot annotate nulls/skips/etc and leaving the stuff out, it still populates. 100% reproducible.

 

Anyone able to figure out how to stop this from happening? the schema is just an example, but I really want to leave out the things I don't want, without having to later array filter them or remove them.

 

Example Data:

 

 

something : [
 {
  "id": "dddddd",
  "value": "adsfasdfasdf"
 },
 {
  "id": "ttt",
  "value": "ttt"
 }
]

 

 

 

 

 

Schema

something : [
 {
   "value" type string
 },
 {
   "value" type string
 }
]

 

 

 

2 REPLIES 2
ekarim2020
Super User
Super User

Hi @PikaPika ,

 

Here is a different method that doesn't use Parse JSON. We can use a Select action to specify the property we want to select (extract).

Snag_733057.png

The example below selects the value property, and uses Text Mode to return just the value property. The output of the Select action will be an array containing the value property:

Snag_774bbb.png

The runtime show that the Select action produces an an array containing the value property:

Snag_78caf9.png

 

Snag_7e07bb.png

 

Hope this helps.


Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

HI and thanks!!

 

Totally agree in simple jsons it works ok to add another step, but in more complex it becomes impossible especially based on layers of objects because then you need arrays and indexes etc.

 

It would just be nice if I said here is my schema (like I can in c#) and only populate these and ignore the rest 🙂

 

Thanks again!!!

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (3,797)