cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
shabila97
Helper I
Helper I

Compare date in PowerApps

Hi all,

 

I have a field in SharePoint List name "Expired Date".

 

In PowerApps, how can I compare date today() with "Expired Date" in SharePoint List on specific item (Visitor Name)?

 

For example:

I want to compare Brinta's Expired Date <= today(). How can I used LookUp function to retrieve 2 column for visitor name and expired date? How can I know Brinta's ID so that I will get her expired date using that ID and start to compare the date with today?

 

powerapps.PNG

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

HI @shabila97 ,

Could you please share a bit more about your scenario?

Do you want to compare Brinta's Expired Date <= today() within your app?

Further, could you please share a bit more about the Visitor Name column? Is it a Single text column or Person type column?

 

Based on the needs that you mentioned, I think the LookUp function could achieve your needs. I have made a test on my side, please take a try with the following workaround:

If the Visitor Name column is a Single line text column in your SP list, please take a try with the following formula:

LookUp('YourSPList', 'Visitor Name' = "Brinta", 'Expired Date') <= Today()

If the Visitor Name column is a Person type column in your SP list, please take a try with the following formula:

LookUp('YourSPList', 'Visitor Name'.DisplayName = "Brinta", 'Expired Date') <= Today()

Note: It is not necessary to get the Item ID value for a specific item in your SP list for retrieving the 'Expired Date' column value. You just need to LookUp the specific item record via a unique column, e.g. "Visitor Name" that you mentioned.

 

More details about the LookUp function in PowerApps, please check the following article:

LookUp function

 

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.

View solution in original post

5 REPLIES 5
v-xida-msft
Community Support
Community Support

HI @shabila97 ,

Could you please share a bit more about your scenario?

Do you want to compare Brinta's Expired Date <= today() within your app?

Further, could you please share a bit more about the Visitor Name column? Is it a Single text column or Person type column?

 

Based on the needs that you mentioned, I think the LookUp function could achieve your needs. I have made a test on my side, please take a try with the following workaround:

If the Visitor Name column is a Single line text column in your SP list, please take a try with the following formula:

LookUp('YourSPList', 'Visitor Name' = "Brinta", 'Expired Date') <= Today()

If the Visitor Name column is a Person type column in your SP list, please take a try with the following formula:

LookUp('YourSPList', 'Visitor Name'.DisplayName = "Brinta", 'Expired Date') <= Today()

Note: It is not necessary to get the Item ID value for a specific item in your SP list for retrieving the 'Expired Date' column value. You just need to LookUp the specific item record via a unique column, e.g. "Visitor Name" that you mentioned.

 

More details about the LookUp function in PowerApps, please check the following article:

LookUp function

 

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.

LookUp('YourSPList', 'Visitor Name' = "Brinta", 'Expired Date') <= Today()

This one works well for me!!

 

Thank you @v-xida-msft  

Hi @v-xida-msft ,


I have similar kind of requirement.

 

I have a column Numberdate as a  Single line Text in Sharepoint list .It store some date values like 01/01/2020,01/02/2020..etc

 

I want to compare that column within date range

Collect(CollectionAB,

Filter(
CustomerCareLog,
(NumberDate >= Date(Year(Now()),Month(Now()),1))

&&

(NumberDate <= DateAdd(Now(),-Dropdown2.SelectedText.Value,Months)))

 

Let say Dropdown2.SelectedText.Value is 5 

 

but when i write this expression in button to store record in collection  it is giving error. 

 

Please help.

 

Hi @v-xida-msft ,


I have similar kind of requirement.

 

I have a column Numberdate as a  Single line Text in Sharepoint list .It store some date values like 01/01/2020,01/02/2020..etc

 

I want to compare that column within date range

Collect(CollectionAB,

Filter(
CustomerCareLog,
(NumberDate >= Date(Year(Now()),Month(Now()),1))

&&

(NumberDate <= DateAdd(Now(),-Dropdown2.SelectedText.Value,Months)))

 

Let say Dropdown2.SelectedText.Value is 5 

 

but when i write this expression in button to store record in collection  it is giving error. 

 

Please help.

Anonymous
Not applicable

Hi I have a SP list called event list and i have two columns name  start  date and end date with type date and time i want to give a warning if the user selects a date from the start date to end date.I want powerapp to calculate the duration between start date and end date so the user clicks any date between these two dates it should show the warning 

 

bharathy_0-1636107087319.png

 

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (2,045)