cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
jade7669
Level: Powered On

Need to filter CDS gallery by view with additional conditions

Because I couldn't add these conditions into view in CRM (which requires to check today's date is between 2 date fields in Opportunity record), I would like to add them in PowerApp formula but somehow I can't get them to work:

 

SortByColumns(Search(Filter(Opportunities,'Opportunities (Views)'.'My Open Opportunities','Program Pre-Start Date' <= Today(),'Program Post-Start Date' >= Today()), OppoTextSearchBox.Text, "name"), "estimatedclosedate", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending))

 

'Program Pre-Start Date' and 'Program Post-Start Date' are fields in Opportunity record and I would like to filter to show only Opportunity records if today is between these 2 days.

 

Please help!!

2 REPLIES 2
PowerBack19
Level 8

Re: Need to filter CDS gallery by view with additional conditions

@jade7669 It looks like you might of the greater than and less than backwards. Shouldn't "Today" be greater than (or equal to) the Start Date and less than (or equal to) the End Date?

jade7669
Level: Powered On

Re: Need to filter CDS gallery by view with additional conditions

My goal is to show the records when today is between the pre-start date and post-start date, and therefore the logic was like so.  However, the error I am facing doesn't seem to be related to the condition (please see attached images x 2).  No matter how I set the condition (greater than or less than), error message 'The specified record was not found. Server Response: UserId is empty guid!' - but I don't have UserId in my app and I don't know why it's referenced.  Whenever I removed the part 'Program Pre-Start Date' <= Today(), this error message goes away...  How should I setup the formula so the filter knows to compare the dates to begin with?  Please advise!!

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (3,697)