cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Calendar event from Sharepoint: sort by newest event to oldest event

Hello everyone,

I've connected a calendar app created with sharepoint to powerapp (basically i've created the automatic app made by connecting the sharepoint data to power app). This is the result:

superblueee_0-1610557890802.png

it's everything ok, but the problem is that the the various events are ordered by alphabet (from A to Z or viceversa if I click on the icon selected in the image before posted). How can i tell to powe app that i want to order the events based on the newest created to the oldest created? I need to respect the starting date of the events!

 

  • BrowseGallery's Item formula --> SortByColumns(Filter([@Calendario]; StartsWith(Title; TextSearchBox1.Text)); "Title"; If(SortDescending1; Descending; Ascending)) 
  • superblueee_2-1610558782394.png  onselect formula --> UpdateContext({SortDescending1: !SortDescending1})

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

@superblueee 

So if that is a standard calendar in SharePoint, then the column will be named EventDate use that in your sort.

 

Also, for information, when you have a standard calendar like that, you have to go to the Calendar Tab and then to the List Settings.  Once there, you will see all the columns for the list.  And, when you click on one of the columns to edit, it will show you the FieldName in the URL.

As seen below.

RandyHayes_0-1610573909219.png

RandyHayes_1-1610573947519.png

 

RandyHayes_2-1610573971307.png

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

7 REPLIES 7
Super User III
Super User III

@superblueee 

Please consider changing your Formula to the following:

SortByColumns(
    Filter([@Calendario]; 
        StartsWith(Title; TextSearchBox1.Text)
    ); 
   "Created"; 
   If(SortDescending1; Descending; Ascending)
) 

 

I hope this is helpful for you. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

@RandyHayes 
So thankyou! it is ok, but it doesn't solve the need to respect the calendar order. It's my fault due to the description i gave to the problem before: i don't need to display the newest to the oldest created, but the most recent event (calendar date based) to the latest event (calendar date based)

Super User III
Super User III

@superblueee 

So, whatever date column you want to sort on, just place that name in the part of the formula where I have "Created".  So, if the event start date is in a column called "Start", then just change "Created" to "Start" in that formula.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

@RandyHayes The item is called "Start Time", am I right?

superblueee_0-1610561453147.png

 


If i use "Start time" in that formula it doesn't work

--------------
SortByColumns(
Filter([@Calendario];
StartsWith(Title; TextSearchBox1.Text)
);
"Start time";
If(SortDescending1; Descending; Ascending)
)
--------------------------

Super User III
Super User III

@superblueee 

The column name must match EXACTLY what it is in SharePoint.

To know for certain, you would need to go to the list settings and click on that column name to view the definition.  In the URL (at the end of the URL) it will show you the Exact Name.  Make sure you have that in there.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

@RandyHayes 

I'm so sorry, but I don't know where i can find the list settings for the exact name. The source of the data is a calendar - as the file attached.

I've downloaded the "query.iqy" file related to that source and i've opend it; it is an excel table - the one screenshooted before - and the name of that column is "Start time". But I can deduct that it is not what you were referring before.
I'm so grateful for your help!

Super User III
Super User III

@superblueee 

So if that is a standard calendar in SharePoint, then the column will be named EventDate use that in your sort.

 

Also, for information, when you have a standard calendar like that, you have to go to the Calendar Tab and then to the List Settings.  Once there, you will see all the columns for the list.  And, when you click on one of the columns to edit, it will show you the FieldName in the URL.

As seen below.

RandyHayes_0-1610573909219.png

RandyHayes_1-1610573947519.png

 

RandyHayes_2-1610573971307.png

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (8,604)