web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to get value of ar...
Power Automate
Answered

How to get value of array from a JSON Object using Apply To Each

(1) ShareShare
ReportReport
Posted on by 12

Hi, everybody

I want to get 'C' value when 'B' equals 1 

How can I use it?

 

2018-01-05_11h42_41.png

Categories:
I have the same question (0)
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Eric_Hu,

     

    I have made a test on my side and please take a try with the following workaround:

    • Add a proper trigger, here I use Flow Button trigger.
    • Add a Variables-> “Initialize variable” action, Name set to J, Type set to Object and Values set to object that you provided.
    • Add a “Compose” action, Inputs set to following formula:
    variables('J')?['A']
    • Add a “Apply to each” action, input parameter set to output of “Compose” action.
    • Within “Apply to each” action, add a Condition, click “Edit in advanced mode”, type the following formula:
    @equals(items('Apply_to_each')?['B'],'1')
    • Within “If/yes” branch of Condition, add a Compose 2 action, Inputs field set to following formula:
    items('Apply_to_each')?['C']

    Image reference:1.JPG

     

    2.JPG

    The flow works successfully as below:3.JPG

     

    4.JPG

     

    Best regards,

    Kris

  • Eric_Hu Profile Picture
    12 on at

    Hi @v-xida-msft

     

    Perfect!!! I can work.

    "items('Apply_to_each')?['C']" is I want to know!!!

     

    Thank you very much!!!

  • ilu989 Profile Picture
    164 on at

    Hi @v-xida-msft

     

    I got a similar issue here, do you have any idea to solve it?

    My flow scheme share as follows the link:

    https://drive.google.com/file/d/1m_zFgFYUxs2JZFoQc27ENnzVZTW0ZZlm/view

    The scheme explains:

    Send an HTTP request to take the excel file form SharePoint and invoke the excel's data from HTTP, finally retrieve the pure data form "value", this way is good for avoiding the SharePoint's versioning setting of "Require Check out" and don't need to format the excel file to be the table type, also quick and efficiently, but I stuck with the data after invoking from HTTP, please see below photo for the data get from "Value" and names it rows: 

    https://drive.google.com/file/d/1t32RDFPeorDH5aChbsMxV0ryGUwnUMts/view

    [

    [
    "No",
    "CD",
    "CAT",
    "Sub CAT",
    ],
    [
    2,
    "Add1",
    "Test1",
    "format3",
    "Yes",
    "No",
    ]
    [
    3,
    "Add2",
    "Test2",
    "format3",
    "No",
    "No",
    ]
    ]
    The data has no title, I would like to make the rows has a title, just like below content, because I need the title for each of the rows to define each row to apply to the SharePoint list:
    [
    "No": "2",
    "CD": "Add1",
    "CAT": "Test1",
    "Sub CAT": "format3",
    ],
    [
    "No": "3",
    "CD": "Add2",
    "CAT": "Test3",
    "Sub CAT": "format4",
    ]
    ]
     
    I try to use the Select to convert it, but no idea how to get it, cause the "value" content no title for formula to quote.
    Refer to some article(below link) but their issue has a title and no need to overcome this situation, if you have some idea, please advice, thank you.

    https://powerusers.microsoft.com/t5/Building-Flows/How-to-retreive-or-calculate-minimum-and-maximum-...

     

    Regards,

    ilu989

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 873

#2
Valantis Profile Picture

Valantis 813

#3
Haque Profile Picture

Haque 526

Last 30 days Overall leaderboard