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 Apps
Answered

Canvas App

(0) ShareShare
ReportReport
Posted on by 38

Hello, 

I’m building a canvas app for managing documents and suppliers. I’m using SharePoint lists as my data source,  one is called suppliers in which I store information regarding suppliers. I have a column named “ End Date “ which is a date time column. And a column named “Status” which is a choice column that stores three values ( Active, Renew, Expired). I want the user in my canvas app form to be able to choose a date and then based on the following condition ( if end date is less than today the value in status column will be active automatically , if end date is bigger than today the value in status column will be expired automatically, and if 180 days are remaining until end date the value in status column will be renewed automatically ) how can I achieve this exactly? 

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

    Hi @S2_0452,

    Could you please share a bit more about yoru form configuration?

     

    I have made a demo for your reference.

    Set the Items property of the ComboBox corrresponding to Status as below:

    Choices(Suppliers.Status)

    Set the DefaultSelectedItems property of this ComboBox as:

    If(DatePicker.SelectedDate<Today()&&DateDiff(DatePicker.SelectedDate,Today(),TimeUnit.Days)<180,{Value:"Active"},
     DatePicker.SelectedDate>Today(),{Value:"Expired"},
     DatePicker.SelectedDate<Today()&&DateDiff(DatePicker.SelectedDate,Today(),TimeUnit.Days)>=180,{Value:"Renew"}
    )
  • S2_0452 Profile Picture
    38 on at

    Worked! Thank you so much 

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 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard