Hello there,
I am creating a parking reservation app, where I want the parking spot owner to free his spot (during wfh) for a range of days.
The tricky thing that I am trying to implement though, is that the range should not be a single record (i.e. available from November 1st to 5th November).
Instead, I want the owner to free the position and on the SharePoint list to record 4 separate records (sorry for the EU dates)
1/11-2/11
2/11-3/11
3/11-4/11
4/11-5/11
So there should not be two columns like this:
Available from | Available to
1/11 | 5/11
instead what I would like is :
Available from
1/11
2/11
3/11
4/11
Thank you very much @rsaikrishna , really appreciate it.
Your suggestion along with this (powerusers side post) helped me achieve the solution I was looking for! 🙂
Use DateDiff function to find out the number of day between the date range.
Documentation link: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-dateadd-datediff
Let us assume, you got 5. Now, you can create a collection with all the required SharePoint list items as below:
// Replace with the DateDiff value
ClearCollect(colNoOfDays, sequence(5))
// Creating collection of SP list items to be created
Collect(colSPItems, ForAll(colNoOfDays, { Title: <SP List Title>, AvailableFrom: DateAdd(AvailableFrom,ThisRecord.Value) })
// This will create 5 items in SP list.
Collect(<SPList>,colSPItems)
I did not try in my personal tenant but you can try this approach.
Regards
Krishna Rachakonda
If this reply helped you to solve the issue, please mark the post as Accepted Solution. Marking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone. |