web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Splitting date range t...
Power Apps
Answered

Splitting date range to different Sharepoint records

(0) ShareShare
ReportReport
Posted on by 48

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

 

Categories:
I have the same question (0)
  • Verified answer
    rsaikrishna Profile Picture
    3,703 on at

    @SmoothOperator 

     

    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 SolutionMarking 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.

     

  • SmoothOperator Profile Picture
    48 on at

    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! 🙂

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 602

#2
WarrenBelz Profile Picture

WarrenBelz 473 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 310

Last 30 days Overall leaderboard