Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

How to parse through nested json and have conditional email recipients with conditional attachment based on value obtained in Power Automate

(0) ShareShare
ReportReport
Posted on by

Hi,
I am a relative beginner to power automate and I am facing some hurdles with my flow.


So, want to parse through this particular nested json snippet in my Compose field (no sensitive information), and 

 
[
    {
      "project": "project1",
      "BusinessOwner":
        {
        "Email": ["abc@gmail.com"]
        },
      "TeamMember":
        {
        "Email": ["def@gmail.com"]
        }    
    },
    {
      "project": "project2",
      "BusinessOwner":
        {
        "Email": ["efg@gmail.com"]
        },
      "TeamMember":
        {
            "Email":
            ["ghi@gmail.com",
            "ijk@gmail.com"]
        }
    }
  ]
Basically, this is my current idea of how the flow will go - 
 
I want to parse through the "BusinessOwner" and "TeamMember" fields, then take in the variable length array, and use these email addresses in the Send an Email action to send emails based on "project" value. I also need to have attachment in the mail which is stored in a SharePoint List and I want to map it to "project" value dynamically. "BusinessOwner" email addresses go in the "To" section of the mail and "TeamMember" email addresses go in the "CC" section of the mail. Both "Email" fields in "BusinessOwner" and "TeamMember" entries are of variable length.
 
The SharePoint List has only one column "project" and the values are:
project1
project2
and both "project" values have a single distinct attachment each.
 
Based on the "project" value the email recipients and attachment from the SharePoint List is to be added.
 
 
Could someone please help me out? I have tried multiple attempts to achieve this, but to no avail.
 
If any further information is required, then please let me know!
 
Thanks!
 
 
 
 

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard