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

json output schema

II have a question how to parse the following json output into the right schema output.

 

 

 

 

{
    "ID_1": {
        "id": "1",
        "campaignname": "Name_1",
        "label": "Name_1",
        "routepointname": "RP_Name_1",
        "perc_sl": "81.1"

    },
    "ID_2": {
        "id": "2",
        "campaignname": "Name_2",
        "label": "Name_2",
        "routepointname": "RP_Name_2",
        "perc_sl": "90"
    }
}

 

 

 

 

 

The json output can have different ID's like ID_1, ID_2. I don't know how to handle these types of arrays in a proper schema.

I want to use the output per ID in the flow. In this case the perc_sl of ID_2.

1 ACCEPTED SOLUTION

Accepted Solutions

 

Hi @WvN ,

 

I am afraid this is difficult to achieve. We need to rely on the property name to obtain the property value, but the object name you provide is dynamic. Even if the data is parsed using Parse JSON, it is still difficult to obtain the specific attribute value.

 

If the property name can be obtained in advance, then we can call the property name when configuring expression. Like:

3.PNG4.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-bacao-msft
Community Support
Community Support

 

Hi @WvN ,

 

This is not an array, it is just an object, you can directly use Parse JSON to parse this content.

 

Please refer to the article to get more details about Parse JSON:

A Thesis on the Parse JSON action in Microsoft Flow — John Liu .NET

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi there, thanks for helping in this case.

The problem I have is I want to handle multiple objects. The Object ID's can be different per HTTP get request. The schema I have looks like this now:

{
    "type": "object",
    "properties": {
        "1199": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "campaignname": {
                    "type": "string"
                },
                "routepointname": {
                    "type": "string"
                },
                "perc_sl": {
                    "type": "string"
                }
            }
        },
        "2194": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "campaignname": {
                    "type": "string"
                },
                "routepointname": {
                    "type": "string"
                },
                "min_sl_perc": {
                    "type": "string"
                }
            }
        }
    }
}

I want to know if it is possible to use variable objects. In the end I want to store the value for 1199 -> perc_sl, 2194 -> perc_sl and for <new ID> -> perc_sl.
The content of each object is the same for all. Is there a way to make the object ID as a variable in the schema?

Thanks

 

Hi @WvN ,

 

I am afraid this is difficult to achieve. We need to rely on the property name to obtain the property value, but the object name you provide is dynamic. Even if the data is parsed using Parse JSON, it is still difficult to obtain the specific attribute value.

 

If the property name can be obtained in advance, then we can call the property name when configuring expression. Like:

3.PNG4.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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 (4,285)