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

Issue with retrieving JSON array items

Hi everybody,

 

I have an issue with something that should be easy and might be reason why I don't find any threads pointing me towards the right solution:
I have an HHTP-Post / Receive HHTP request workflow in which I am posting a JSON array. It is received properly but then I have the challenge of not being able to retrieve individual items from the object. So you understand better here is the JSON I receive:

 

[
  {
    "Filename": "XXXXXXXXXXXXXX",
    "Path": "https://jnj.sharepoint.com/teams/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.xls"
  },
  {
    "Filename": "XXXXXXXXX",
    "Path": "https://jnj.sharepoint.com/teams/XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.xlsm"
  }
]

 

I now want to access the individual filenames and their according paths individually. This is because I want to create a Planner Task in the next step that is ONE task but contains both JSON results in the task description.

 

Anyone knowing how to achieve this?

 

Thank you and best regards

JHL

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
jinivthakkar
Resident Rockstar
Resident Rockstar

@JHL1 please find the flow:

 

jinivthakkar_0-1616590350431.png

 

Details:

jinivthakkar_1-1616590408172.png

 

jinivthakkar_2-1616590427803.png

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "Filename": {
                "type": "string"
            },
            "Path": {
                "type": "string"
            }
        },
        "required": [
            "Filename",
            "Path"
        ]
    }
}

Parse json schema in above block

jinivthakkar_3-1616590543697.png

output

jinivthakkar_4-1616590603397.png

I added 1 at the end of xx to identity if flow works fine.

 

Hope this helps.

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 

 

 

 

 

View solution in original post

2 REPLIES 2
jinivthakkar
Resident Rockstar
Resident Rockstar

@JHL1 please find the flow:

 

jinivthakkar_0-1616590350431.png

 

Details:

jinivthakkar_1-1616590408172.png

 

jinivthakkar_2-1616590427803.png

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "Filename": {
                "type": "string"
            },
            "Path": {
                "type": "string"
            }
        },
        "required": [
            "Filename",
            "Path"
        ]
    }
}

Parse json schema in above block

jinivthakkar_3-1616590543697.png

output

jinivthakkar_4-1616590603397.png

I added 1 at the end of xx to identity if flow works fine.

 

Hope this helps.

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 

 

 

 

 

View solution in original post

JHL1
Frequent Visitor

@jinivthakkar Thank you for your help🙏🙏.

You pointed me towards the right direction. I added an 'append to string'-variable at the end of the Ate-loop. Succeeding the Ate-loop I then I split the string by a delimiter I also added in the Ate-loop. Following that I then write the individual values to individual variables.

This is not very elegant, yet effective. 

I will accept your response as solution but keep wondering if there is a more elegant approach for what I am after. I mean think about if I instead of two values, as right now, had to extract 20 or even only 5. Way to manual handling for my taste. Any ideas on that @jinivthakkar or anyone else?💪💪🧐🧐

 

Thanks again and have a good one💪💪 

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (47,977)