Skip to main content

Notifications

Community site session details

Community site session details

Session Id : SLpGRgaqhs8N7Q1UGWfTjJ
Power Automate - Building Flows
Answered

parsing jason in Flow

Like (0) ShareShare
ReportReport
Posted on 17 Dec 2018 18:54:26 by 7

Hi:

 

Below is my JSON:

 

{
"people": [
{
"Name": "IT",
"email": "m@xxx.com"
},
{
"Name": "Finance",
"email": "g@yyy.com"
}
]
}

 

I have a start an approval process as my trigger and I need to send corresponding email when user selects IT or Fianace in sharepoint form, can someone please help. If a user selects IT on sharepoint form, I need to assign 'm@xxx.com' to 'assigned to' field

 

  • Mast-KBI Profile Picture
    7 on 20 Dec 2018 at 19:21:09
    Re: parsing jason in Flow

    The solution helped me, even though JSON parsing is giving me error and I was able to circuvent the issue. Thanks again!

  • Mast-KBI Profile Picture
    7 on 18 Dec 2018 at 17:11:21
    Re: parsing jason in Flow

    I am not sure how to paste the screen shot, I am getting below error:

     

    InvalidJSON: The content property of actions of type 'ParseJson' must be valid JSON. The provided value 'Parse_JSON' cannot be parsed: 'Unexpected chracter encountered while parsing value: P.path", line 0, position 0.'.

     

    Content

     

    Parse_JSON

     

    Schema:

    {
    "people": [
    {
    "Name": "IT",
    "email": "mvvv@nn.com"
    },
    {
    "Name": "Finance",
    "email": "mnn@nn.com"
    }
    ]
    }

     

    I have manually entered the schema to make sure there are no while spaces and while I saved, gave me no error but getting error while running the flow, appreciate your help

  • Verified answer
    v-yamao-msft Profile Picture
    on 18 Dec 2018 at 07:54:37
    Re: parsing jason in Flow

    Hi @Mast-KBI,

     

    Please consider adding Parse JSON action in your flow. Please check the following doc for a reference:

    https://flow.microsoft.com/en-us/blog/five-services-json-http/

    I have made the following test for my scenario.

    Trigger the flow with a manual button, add two options IT and Finance.

    Add action Parse JSON, input the following JSON.

    {
    "people": [
    {
    "Name": "IT",
    "email": "test4@xxxx.onmicrosoft.com"
    },
    {
    "Name": "Finance",
    "email": "mabel@xxxx.onmicrosoft.com"
    }
    ]
    }

    Add Compose action and rename it to IT with the following code:

    body('Parse_JSON')['people'][0]['Name']

     Add Compose action and rename it to ITEmail with this code to return the email address of name IT:

    body('Parse_JSON')['people'][0]['email']

     The similar configuration with Finance and the corresponding email address.

     

    body('Parse_JSON')['people'][1]['Name']
    
    body('Parse_JSON')['people'][1]['email']

     

     Add the action send an email, input the following code to send email to IT or Finance based on the selection from the trigger:

    if(equals(triggerBody()['text'],'IT'),outputs('ITEmail'),if(equals(triggerBody()['text'],'Finance'),outputs('FinanceEmail'),''))

     A screenshot for your reference:

    1.PNG 

     

    Best regards,

    Mabel

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard
Loading started