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

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Expression not working
Power Automate
Answered

Expression not working

(0) ShareShare
ReportReport
Posted on by 240

Hi Folks,

 

Here is the JSON Structrue, 

PowerUser0_0-1658480285255.png

Now, I am using this expression, as shown below, but this is not working as expected, can someone help me out ?

PowerUser0_1-1658480429245.png

@ekarim2020 it is the same json structure as previous. I am trying to match which consent is true and which is false

 

Thanks in advance.

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,480 Most Valuable Professional on at

    Hi @PowerUser0,

     

    You are checking if the accepted value equals 1. Try checking if it equals true instead.

     

    Try something like below:

    if(equals(items('Apply_to_each_-_Index_of_Promotional_Communication_Preference')?['accepted'], true), variables('indexCount'), '')

     

     

  • Verified answer
    Ellis Karim Profile Picture
    11,796 Super User 2026 Season 1 on at

    I realised I missed the Accepted property from the source data. I have updated the solution with the Accepted property. Please trySolved: Re: Format into proper JSON structure - Power Platform Community (microsoft.com)

    to see if that resolves your issue.

     

    Here is an extract:

    Snag_1030cedc.png

    The expressions used are:

    1: items('Apply_to_each')?['formResponse']?['answers']

    2: item()?['question~']?['name']

    3: item()?['answerDetails']?['com.linkedin.ads.TextQuestionAnswer']?['answer']

    4: items('Apply_to_each')?['formResponse']?['consentResponses']?[0]?['accepted']

     

    This is the data that I was able to extract:

    [
     {
     "First Name": "Ghoghe",
     "Last Name": "Manta",
     "Email Address": "ar1975@gmail.com",
     "Company Name": "TAXI SPEED",
     "Country": "Romania",
     "Job Title": "Taxi Driver",
     "Accepted": false
     },
     {
     "First Name": "alxandra",
     "Last Name": "petror",
     "Email Address": "perr@gmail.com",
     "Company Name": "opica",
     "Country": "Romania",
     "Job Title": "Sales Consultant",
     "Accepted": false
     },
     {
     "First Name": "Anda",
     "Last Name": "Ros",
     "Email Address": "andreamsu@gmail.com",
     "Company Name": "DWF - Genuine SEO Agency",
     "Country": "Romania",
     "Job Title": "SEO Project Manager",
     "Accepted": false
     },
     {
     "First Name": "Gabriel",
     "Last Name": "Pastrav",
     "Email Address": "gabrielv@gmail.com",
     "Company Name": "goldenfishromania",
     "Country": "Romania",
     "Job Title": "Owner",
     "Accepted": false
     },
     {
     "First Name": "Catalin",
     "Last Name": "Bejan",
     "Email Address": "cbn@outlook.com",
     "Company Name": "Forston Development",
     "Country": "Romania",
     "Job Title": "Business Development Manager",
     "Accepted": true
     },
     {
     "First Name": "Cristina",
     "Last Name": "Cristescu",
     "Email Address": "cristin@yahoo.com",
     "Company Name": "Witfuse Solutions",
     "Country": "Romania",
     "Job Title": "Executive Coach",
     "Accepted": false
     }
    ]

     


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

     

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 237 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 176 Super User 2026 Season 1

#3
Power Platform 1919 Profile Picture

Power Platform 1919 96 Super User 2026 Season 1

Last 30 days Overall leaderboard