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 / How can i get object i...
Power Automate
Unanswered

How can i get object items from json variable?

(0) ShareShare
ReportReport
Posted on by 11

Hi,

In the Sharepoint list, I keep the json in the multiline of text column as in the example.

[

{"currentUserName":"Serper, Emre(Contractor)","currentTime":"6/12/2021 - 16:42","currentUserComment":"Congrats!"},{"currentUserName":"Test, Test(Contractor)","currentTime":"6/12/2021 - 16:42","currentUserComment":"Congrats!"}

]

I have this json in the CommentsJson.

I want to pass the user name and comment inside in this json file to the variables.

 

-I am adding the json field into compose as array.

-I'm returning in compose with apply to each. And I'm trying to add to variables.

 

But it gives the error in the last picture. Can you help me?

 

Untitled.png

 

Categories:
I have the same question (0)
  • Paulie78 Profile Picture
    8,422 Moderator on at

    You don't need to use the array() function in your top compose action - because the item you are extracting is already an array. So you have made an array of one element which contains a string representation of inner array. Try using the same expression without wrapping it in the array() function.

  • emreserperjp Profile Picture
    11 on at

    Hi @Paulie78 , when I do as you said it gives this error.

    dd.PNG

  • Verified answer
    Paulie78 Profile Picture
    8,422 Moderator on at

    Try wrapping it in the json() function

  • emreserperjp Profile Picture
    11 on at

    @Paulie78 

    Great, this worked!
    Thank you so much.

     

    Can I ask one more question?

    There will be more than one object in this json and they will all be returned.
    If I want to get only the last object in this file, how do I go about it?

    Since it will return all its objects, it will be the last in the variables, but is there a different way to do this?

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

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard