cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Unable to filter SharePoint Event List based on date

I have a SharePoint Event List "Change Control Calendar".  When I pull it into PowerApps and sort, no prolem.  When I try and filter on the date, no records are returned.

 

Here's the front end variable set up:

 

Set(_AllChangeItems, Sort('Change Control Calendar', 'Start Time', Descending));
Set(_PreviousWeek, Filter(_AllChangeItems, DateValue(Text('Start Time')) >= DateValue(Text(DateAdd(Today(),-7,Days))))); Navigate(SelectView, ScreenTransition.Fade)

 

I am then using _PreviousWeek on the data item source:

 

Sort(_PreviousWeek,'Start Time', Descending)

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@Anonymous 

Have you tried it without all of the text conversions?

 

Set(_AllChangeItems, Sort('Change Control Calendar', 'Start Time', Descending));
Set(_PreviousWeek, Filter(_AllChangeItems, 'Start Time' >= DateAdd(Today(),-7,Days))); 
Navigate(SelectView, ScreenTransition.Fade)

Works well here!

 

I hope that helps you out.

 

 

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

View solution in original post

2 REPLIES 2
RandyHayes
Super User III
Super User III

@Anonymous 

Have you tried it without all of the text conversions?

 

Set(_AllChangeItems, Sort('Change Control Calendar', 'Start Time', Descending));
Set(_PreviousWeek, Filter(_AllChangeItems, 'Start Time' >= DateAdd(Today(),-7,Days))); 
Navigate(SelectView, ScreenTransition.Fade)

Works well here!

 

I hope that helps you out.

 

 

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

View solution in original post

v-xida-msft
Community Support
Community Support

Hi @Anonymous ,

Based on the issue that you mentioned, I think there is something wrong with the _PreviousWeek variable that you set within your app.

 

I have made a test on my side, please consider take a try to modify your formula as below:

 

Set(_AllChangeItems, Sort('Change Control Calendar', 'Start Time', Descending));
Set(
_PreviousWeek,
Filter(
_AllChangeItems,
Value(Text('Start Time', "[$-en-US]yyyymmdd")) >= Value(Text(DateAdd(Today(),-7,Days), "[$-en-US]yyyymmdd"))
)
);
Navigate(SelectView, ScreenTransition.Fade)

Or

 

Set(_AllChangeItems, Sort('Change Control Calendar', 'Start Time', Descending));
Set(
_PreviousWeek,
Filter(
_AllChangeItems,
'Start Time' >= DateAdd(Today(), -7, Days)
)
);
Navigate(SelectView, ScreenTransition.Fade)

 

In addition, you could also consider take a try to use the following formula on the data item source directly (instead of using variable😞

Sort(
Filter(
'Change Control Calendar',
Value(Text('Start Time', "[$-en-US]yyyymmdd")) >= Value(Text(DateAdd(Today(),-7,Days), "[$-en-US]yyyymmdd"))
),
'Start Time',
Descending
)

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (12,422)