cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Issues with filtering array and multi-select field

I may just be overthinking this. I'm fairly new to Flow so I'm not sure what I am doing wrong.  Thanks in advance.

 

Scenario: I created a list where we are storing items with an Expiration Date. I created a multi-select field that contains the following 4 values: 45 days, 30 days, 15 days and 7 days to allow a user to choose at which days they want an expiration notice email.

For example, if the expiration day is April 17, and today is April 10, and 7 days is chosen, I will get an email today alerting me. They can choose multiple alerts.

 

My Condition statement is working but I cannot get a single row of data for my HTML table. I am getting 5 rows of correct duplicated data in the HTML table doing it one way I tried (I have 5 items in my SP list so this is why for whatever reason), and I am getting 2 rows of data (the number of boxes that were checked in the multi-select) another way. I'm not sure what I am doing wrong. Can someone help? 

 

My condition is checking if the Expiration Day = NumberOfDays+TodaysDate and it works fine. It only enters Yes when I want it should.

 

My filter array gives me the same for input as output when I test. I was attempting to just grab the first row where notification rule = option that was chosen (Output_9 is basically equal to "15 days") but it honestly does not matter which row I get. If I have gotten this far, the item details will all be the same (see HTML table output below). I just need a single row in the array for my HTML table. 

 

notificationrule1.pnghtmltable1.PNG

 

This is what my array output:

[
  {
    "@odata.type""#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    "Id"1,
    "Value""30 days"
  },
  {
    "@odata.type""#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    "Id"2,
    "Value""15 days"
  }
]
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Hi @lizc00,

 

I think your Flow is a little messy and the logic is not very clear. Here I create two Flow to implement your requirements according to your description.

SharePoint columns, NotifactionRule is multiple choice and ExpirationDay is multiple lines of text:

Annotation 2020-04-13 151438.png

Flow one, when an item created in the list, initialize a string variable to hold the Expiration Days, then it will get the string shows above:

addDays(body('Get_item')?['Created'],int(item()?['Value']),'yyyy-MM-dd')

Annotation 2020-04-13 151059.png

 

 

Annotation 2020-04-13 151625.pngAnnotation 2020-04-13 151154.png

 Flow two, Create a recurrence runs every day to check whether have item expired, 

Annotation 2020-04-13 152752.png

 This part is converting the Expiration day into an array, then use the contains to check the utcNow() whether it exists in the array, if it exists, send a notification email.

Annotation 2020-04-13 152800.png

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Dual Super User III
Dual Super User III

Hi!
Is the condition inside an 'Apply to each' iterating all through your SP list items? Or... Iterating oll through multivalue column? Or... no Apply to each? Or...
Can you share a screenshot of the whole flow design? The more context info, the faster you will get a valid suggestion
Thanx!


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
New Member

Hi,

 

I am adding screenshots with the whole workflow and the SharePoint Item for details on what I'm working on. Please let me know if I'm not making sense. I've tried Filter array using the entire SP list items to just get my current item but it doesn't seem to work for me. I'm sure I am doing it wrong just do not get where I am going wrong. I think I may have provided too many details now. 

SP Item:

item.PNG

Flow:

Capture.PNGCapture1.PNG

 

Actual run where Expiration Date is a match:

Run1.PNGRun2.PNGRun3.PNGRun4.PNG

Intput and output of Array is:

[
  {
    "@odata.type""#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    "Id"1,
    "Value""30 days"
  },
  {
    "@odata.type""#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    "Id"2,
    "Value""15 days"
  }
]
 
Thanks in advance for any advice!
Highlighted
Community Support
Community Support

Hi @lizc00,

 

I think your Flow is a little messy and the logic is not very clear. Here I create two Flow to implement your requirements according to your description.

SharePoint columns, NotifactionRule is multiple choice and ExpirationDay is multiple lines of text:

Annotation 2020-04-13 151438.png

Flow one, when an item created in the list, initialize a string variable to hold the Expiration Days, then it will get the string shows above:

addDays(body('Get_item')?['Created'],int(item()?['Value']),'yyyy-MM-dd')

Annotation 2020-04-13 151059.png

 

 

Annotation 2020-04-13 151625.pngAnnotation 2020-04-13 151154.png

 Flow two, Create a recurrence runs every day to check whether have item expired, 

Annotation 2020-04-13 152752.png

 This part is converting the Expiration day into an array, then use the contains to check the utcNow() whether it exists in the array, if it exists, send a notification email.

Annotation 2020-04-13 152800.png

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (13,157)