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 Platform Community / Forums / Power Apps / Set the expiration of ...
Power Apps
Answered

Set the expiration of a record

(1) ShareShare
ReportReport
Posted on by 174
Hello,
can I use the date of creation a record made through a form to set the expiration after a year, so I can see the date of expiration, I can set the "Status" active/inactive accordingly and even set the icon (circle) changing colour red to green?
How pls?
 
Thank you
 
Can something like this, posted by Nirav (Akira28)  work? It didnt in this particular way, maybe it can be slightly modified:
 
Select your form add the below code on success - 
 
>>  Set(varExpirationDate, DateAdd(ThisItem.CreatedDate, 365, Days));
 
Set the gallery or data card with label control and set text property to -
 
>>If(Today() > varExpirationDate, "Inactive", "Active")

Add a Circle Icon on the screen and set the fill property to - 
 
>>If(Today() > varExpirationDate, Red, Green)
 
 
 
Can I even use default column "status" in dataverse table to work with it?
 
I tried to put this simply as in the screenshot so I just see the color changed, yet it doesnt work...errors:
-identificator "status" doesnt recognized
-false argument (color). expected boolean.
-some argument of function if not valid
-color value expected
 
 
 
Categories:
  • Verified answer
    enriqueglopez Profile Picture
    516 Moderator on at
    I think you are misunderstanding the default Status column in dataverse. 
     
    If you only want to manage this via User Interface, I would do the following using 'Created' column directly. 
     
    Fill property of your dot: If(DateDiff(ThisItem.Created, Today()) > 365, RED, GREEN)
     
    If you want to set the Column status to inactive when its older than a year, I would use a daily power automate that gets all items older than a year with status column = 'Active', the update the status column to 'Inactive', but I don't know if you will find any trouble with this, because Status is a default system column in Dataverse.
     
    Maybe you could create a 'Custom status' column.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard