cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Hid
Level: Powered On

filter out duplicates

Hi,

 

I have a flow that is running against a document library once a week. It has two conditions:

 

  1. find all items that were modified the prior week.
    @greaterOrEquals(items('Apply_to_each')?['Modified'], addDays(utcNow(),-7))

  2. Of those items, find all items where the MMMulti field is empty.

    @empty(items('Apply_to_each')?['MMMulti'])

Once this is done I send an email to the document Author. This is all working fine. My question is this, users sometimes upload multiple documents. I don't want to send them an email for each uploaded document, just a single email. I am not familiar enough with Flow or arrays(?) and loops to make this work. I'm visualizing something that loops through all of the items after step 2, creates an array of Authors, remove items where the Author is duplicated within the array, then use the remainig array of Authors as the list to send emails too.... but I have no idea if something like this is possible. Does anyone have an example of a similar process they can share?

 

Thanks!

H

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: filter out duplicates

Hi @ Hid,

Do you want to send an email to the author if the author uploads one or more articles within two weeks?

What is the type of the MMMulti column in your document library?

 

I have made a test on my side , you could create a flow as steps below:

  1. Add a trigger “Recurrence”, the configuation of my flow would run at 10:00 on Monday every weeks.
  2. Add action “Get items”, fill in the “Site Address” field, and fill the document library name in the “List Name” field.
  3. Add a variable, name the variable as “All authors”, the type of the variable choose Array, leave the Value field blank.
  4. Add an Apply to each, add a Condition inside the Apply to each, the expression in the Condition as below:
@and(greaterOrEquals(items('Apply_to_each')?['Modified'], addDays(utcNow(),-7)),empty(items('Apply_to_each')?['MMMulti']))

      5. Add an append to array variable inside the If yes branch of the Condition, choose the All authors in the “Name” field, choose the “Created By Email” dynamic content of action “Get items” in the “Value”field. 

      6. Outside the Apply to each, add a Compose, the expression in the Inputs field as below:

 

union(variables('All authors'),variables('All authors'))

      7. Add an Apply to each 2, choose the Output dynamic content of Compose in the input field.

      8. Add action “Send an email”, choose the “Current item” dynamic content of Apply to each 2 in the To field, fill in the  Subject and Body field.

 

Image reference:

1.png2.png

 

The flow would run successfully as below:

 3.png

 

 

 

 

 

Regards,
Alice Zhang

3 REPLIES 3
Community Support Team
Community Support Team

Re: filter out duplicates

Hi @ Hid,

Do you want to send an email to the author if the author uploads one or more articles within two weeks?

What is the type of the MMMulti column in your document library?

 

I have made a test on my side , you could create a flow as steps below:

  1. Add a trigger “Recurrence”, the configuation of my flow would run at 10:00 on Monday every weeks.
  2. Add action “Get items”, fill in the “Site Address” field, and fill the document library name in the “List Name” field.
  3. Add a variable, name the variable as “All authors”, the type of the variable choose Array, leave the Value field blank.
  4. Add an Apply to each, add a Condition inside the Apply to each, the expression in the Condition as below:
@and(greaterOrEquals(items('Apply_to_each')?['Modified'], addDays(utcNow(),-7)),empty(items('Apply_to_each')?['MMMulti']))

      5. Add an append to array variable inside the If yes branch of the Condition, choose the All authors in the “Name” field, choose the “Created By Email” dynamic content of action “Get items” in the “Value”field. 

      6. Outside the Apply to each, add a Compose, the expression in the Inputs field as below:

 

union(variables('All authors'),variables('All authors'))

      7. Add an Apply to each 2, choose the Output dynamic content of Compose in the input field.

      8. Add action “Send an email”, choose the “Current item” dynamic content of Apply to each 2 in the To field, fill in the  Subject and Body field.

 

Image reference:

1.png2.png

 

The flow would run successfully as below:

 3.png

 

 

 

 

 

Regards,
Alice Zhang

Hid
Level: Powered On

Re: filter out duplicates

Thanks a million Alice! I'll give this a try and let you know how it goes. My MMMulti field is a managed metadata multi-select field.

Hid
Level: Powered On

Re: filter out duplicates

Alice's directions worked like a charm. Thanks!

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 327 members 4,903 guests
Please welcome our newest community members: