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
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
Hi @Anonymous,
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'])
If so, the date field should formate:
addDays(variables('StartDate'), variables('NumberOfDay'),'yyyy-MM-dd')
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.
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1