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

Help adding a Get & Delete to my existing flow? - SCREENSHOTS ATTACHED

I have built the below Flow which takes a range between 2 dates (Example: 27/11/2019 - 30/11/2019) and multi-choice field requesting which days (Example: Wednesday & Friday). The flow then runs through everyday between the range and only creates items in an 'availability' list for dates which fall on one of the days selected (Wednesdays & Fridays in this example case).

 

I need the ability to remove items that exist in the 'availability' list once the automated item is created. (Example: I have an item in the 'availability' list with 'Date field: 27-11-2019' and 'Status field: Available'. But once the flow below runs it creates an item with the same date and status as booked, therefore the 'Available' item no longer is required. I need to slot in a get & delete for the available item after the booked item is created by the flow

 

Take a look below..

Thank you

 

 

1.png

 

2.png

 

3.png

 

4.png

 

5.png

 

6.png

 

3 REPLIES 3
Community Support Team
Community Support Team

Re: Help adding a Get & Delete to my existing flow? - SCREENSHOTS ATTACHED

Hi @ESSteven,

 

So you want to not create an item when the date is occupied, right?

You can use the Get items to check the current date whether is occupied. If the length of return value for Get items is not equal to 0, it means that this date is occupied, the Flow doesn't create an item.

For example:

addDays(variables('StartDate'), variables('NumberOfDay'),'yyyy-MM-dd')
length(body('Get_items')?['value'])


Annotation 2019-11-28 141606.png

 If so, the date field should formate:

addDays(variables('StartDate'), variables('NumberOfDay'),'yyyy-MM-dd')

Annotation 2019-11-28 142238.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.

ESSteven
Level: Powered On

Re: Help adding a Get & Delete to my existing flow? - SCREENSHOTS ATTACHED

No Sorry,

 

I require to know where in the flow I would add a Get & Delete to remove the existing item in the list with the same date (string) & persons name (lookup) of the current 'apply to each' date that the flow is on at that present moment when it creates an item with the same date and persons name as an already existing.

 

Basically: On the Availability list there are placeholders on every future date possible for the year with 3 fields:
1) Date (Date & Time)

2) Name (Lookup)

3) Availability (Choice - Available, Booked)

 

By default all placeholders have all dates filled as Available, My name & every future date possible from today until end of year.

 

The current flow runs perfectly to auto create 'Booked' items in the list when I need it to. However I now need to know wher ein the flow I would add the ability to find the item which has the corresponding date, persons name and 'available' to delete it as now a 'booked item' is in it's place. 

 

Thanks

ESSteven
Level: Powered On

Re: Help adding a Get & Delete to my existing flow? - SCREENSHOTS ATTACHED

@v-litu-msft

Any update on my previous reply?

Thanks

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (6,222)