Hi.
I'm stuck on a flow. I have a List rows present in a table step that then connects to an initialize variable step that creates an array from the values in the List rows step. Then I filter out empty values from the array in the next step. All is well at this point.
Next, I'd like to get distinct values for one value in my filtered array, but I'm running up against the issue that my array values look like this:
{
"@odata.etag": "",
"ItemInternalId": "94a771a7-7f42-4e9f-a12b-820f08814189",
"AssignedEmail": "person.one@email.org"
},
{
"@odata.etag": "",
"ItemInternalId": "901c1c63-a776-4968-85b3-141d96653a82",
"AssignedEmail": "person.one@email.org"
},
That ItemInternalId is making it so that I have no distinct values in my array. How do I dedupe based on the AssignedEmail value?
Thanks for any assistance you can provide!
Solved! Go to Solution.
You can use the Union function to return a distinct or unique set of email addresses.
For example, using the following Excel table containing multiple duplicate email address in the AssignedEmail column:
We can write a flow to select only the AssignedEmail column, then use the Union function to remove the duplicates:
union(body('Select'),body('Select'))
This is the runtime output of the Select action which selects only the AssignedEmail column:
Then we use the Union function to remove duplicate email addresses, which returns an array of distinct email addresses:
Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.
You can use the Union function to return a distinct or unique set of email addresses.
For example, using the following Excel table containing multiple duplicate email address in the AssignedEmail column:
We can write a flow to select only the AssignedEmail column, then use the Union function to remove the duplicates:
union(body('Select'),body('Select'))
This is the runtime output of the Select action which selects only the AssignedEmail column:
Then we use the Union function to remove duplicate email addresses, which returns an array of distinct email addresses:
Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.
Thanks so much for this reply, @ekarim2020 . I think something must be going wrong between my List rows and Select actions. Here's an excerpt of the head of the output from List rows:
[
{
"@odata.etag": "",
"ItemInternalId": "6a943c2e-7768-4264-bc6d-e92ee264dc20",
"AssignedEmail": "person.one@email.org"
},
{
"@odata.etag": "",
"ItemInternalId": "87fc7c33-da2b-4c91-92db-196cc3184404",
"AssignedEmail": "person.two@email.org"
},
{
"@odata.etag": "",
"ItemInternalId": "fec1312c-2d34-49d7-a7e9-a37b430c273a",
"AssignedEmail": "person.two@email.org"
},
When I get to my Select action, I'm not seeing my AssignedEmail field in dynamic content:
[Updated] For your flow, you will need to enter an expression for the AssignedEmail column:
Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.
Yup, that did it, @ekarim2020 . No wonder you're a Community Champion!
Where in this flow would you implement the expression to filter empty values? I know I could add a step after the compose, but would it make more sense to do it prior to the Compose action?
Thanks so much for your help with this; I'velearned a lot.
You can try this method to filter out empty email addresses:
Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.
Turns out this worked:
equals(empty(item()?['AssignedEmail']), bool('False'))
Thanks again for the help, @ekarim2020 !
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
At the monthly call, connect with other leaders and find out how community makes your experience even better.
User | Count |
---|---|
25 | |
24 | |
23 | |
23 | |
19 |
User | Count |
---|---|
58 | |
39 | |
38 | |
29 | |
26 |