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 / Collect List of Calend...
Power Apps
Answered

Collect List of Calendar Events based on Selected Date

(0) ShareShare
ReportReport
Posted on by 95

Hi All,

I have a calendar screen that shows a gallery of items based on date. I would like to collect the selected date events by pressing a button and have them saved as either Excel or Sharepoint list on my Sharepoint site. However, I'm stucked with collecting the selected date's events. The code is shown below. Then, does anyone knows how to export the collected items so I can have them saved to Sharepoint site? 

Alois_0-1603851919952.png



Thanks in advance,
Alois

Categories:
  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    Hi @Alois , 

     

    You'll get the selected date events using (is the item formula for CalendarEventsGallery2):

     

    ClearCollect(BookingList, SortByColumns(Filter(MyCalendarEvents, Text(Start, DateTimeFormat.ShortDate) = Text(_dateSelected, DateTimeFormat.ShortDate)), "Start")

     

    To save this data in a Sharepoint List use:

    ForAll(BookingList, Patch(YourSharePointList, Defaults(YourSharePointList), {Column1: column from BookingList.... })

     

    Due to the lack of info about your SharePoint List schema, i cannot suply a more detailed formula.

     

    Hope it helps ! 

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi@Alois,

    Do you want to export all the selected events to your SP list?

    Could you please share a bit more about your SP list data structure, what are the column types of them?

    Here is my scenario, you could check for reference.

    For that, all the fields in the collection are stored as strings, the key is to convert the data type.

    Here is my SP list.

    Jump.png

    The following is how I collect based on the selected date:

     

    Collect(Events,SortByColumns(Filter(MyCalendarEvents, Text(Start, DateTimeFormat.ShortDate) = Text(_dateSelected, DateTimeFormat.ShortDate)), "Start"))

     

    Add a Button and set the OnSelect property as below:

     

    ForAll(
     Events,
     Patch(
     CalendarEvents,
     Defaults(CalendarEvents),
     {
     Title: Subject,
     StartDate: Start,
     EndDate: End,
     Description: Body,
     Location: {Value: Events[@Location]},
     Organizer: {
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     Department: "",
     Claims: "i:0#.f|membership|" & Organizer,
     DisplayName: Organizer,
     Email: Organizer,
     JobTitle: "",
     Picture: ""
     }
     }
     )
    )

     

    Note: Event is my collection name. 'CalendarEvents' is my SP list name. Please replace it with yours.

    Hope it could help with reference.

    Best Regards,

    Qi

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard