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
The solution helped me, even though JSON parsing is giving me error and I was able to circuvent the issue. Thanks again!
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
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:
Best regards,
Mabel
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional