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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to create a string...
Power Automate
Answered

How to create a string from a unique array record

(0) ShareShare
ReportReport
Posted on by 364

Hi All, 

 

I have a flow that checks the records in 2 different arrays, and then sends an email if any of the records in either array are not present in the other. I use Union(variables('varListA'),variables('varListB')) to combine the arrays, and then compare the lengths to see if there are any differences. 

 

What I would like to do is pull a string value for the any records that are present in the first array, but not the second. So if 11 out of 12 records in both arrays match, I would like to create a string value for the 12 record so I can then email information on it to the proper person.

 

Aurora_0-1678139171832.png

 

varListA and varListB are my 2 arrays, and they always have 12 records in them. Any number of records could be different when the flow runs, but typically it would be one. Does anyone have any suggestions for how I could try to pull these specific records from varListA? 

Categories:
I have the same question (0)
  • v-xiaochen-msft Profile Picture
    on at

    Hi @Aurora ,

     

    Could you provide the sample array data?

     

    Best Regards,

    Wearsky

  • Aurora Profile Picture
    364 on at

    @v-xiaochen-msft 

     

    Both arrays should look like this: 

    Aurora_0-1678191774131.png

    Aurora_1-1678191850212.png

     

     

    An example of the use case I'm interested in would be if the value for part number "431-450-8013" increased from 4 to 5 in varListA, but not varListB. I'd then send an email that details the increase for that part number. Please let me know if I need to do a better job of explaining.

     

  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at

    Hopefully this is what you're looking for.

     

    varListA contains the following data.

    [
     {
     "Name": "Sample 1",
     "Amount": 110
     },
     {
     "Name": "Sample 2",
     "Amount": 200
     },
     {
     "Name": "Sample 3",
     "Amount": 200
     }
    ]

    grantjenkins_2-1678192782387.png

     

    varListB contains the following data.

    [
     {
     "Name": "Sample 1",
     "Amount": 110
     },
     {
     "Name": "Sample 3",
     "Amount": 200
     },
     {
     "Name": "Sample 4",
     "Amount": 250
     }
    ]

    grantjenkins_1-1678192767332.png

     

    The highlighted items are missing from the other array. For example, Sample 2 is in List A but not in List B, and Sample 4 is in List B but not in List A.

     

    Filter array List A will return items in List A that are not in List B.

    grantjenkins_3-1678192910782.png

    grantjenkins_6-1678193480407.png

     

    Filter array List B will return items in List B that are not in List A.

    grantjenkins_4-1678192940395.png

    grantjenkins_7-1678193504931.png

     

    Compose uses a union expression to join the items from Filter array List A and the items from Filter array List B, giving us a list of all the items that are different across both arrays. The expression used is:

    union(body('Filter_array_List_A'), body('Filter_array_List_B'))

    grantjenkins_5-1678193028960.png

    grantjenkins_8-1678193590945.png


    ----------------------------------------------------------------------
    If I've answered your question, please mark the post as Solved.
    If you like my response, please consider giving it a Thumbs Up.

  • Chriddle Profile Picture
    8,443 Super User 2025 Season 2 on at

    Use Filter action with contains function on ArrayA

    Chriddle_0-1678193940300.png

     

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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard