web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Date Auto Populates in...
Power Apps
Unanswered

Date Auto Populates into field once status is selected as Closed

(0) ShareShare
ReportReport
Posted on by 341

I have a Status drop down that has Open or Closed. If the status is selected closed, I need the date to auto populate date, hour, minutes. My setup is Shown below. What functions do I need to use for each?

 

Evan_S1_0-1698174189964.png

 

Categories:
I have the same question (0)
  • Devvj Profile Picture
    1,132 Super User 2024 Season 1 on at

    Hi @Evan_S1 

    You could use the Now() to get the current date/time, and then format it accordingly using Minute(Now()) and Hour(Now()) to get the current minute and hour accordingly.

  • Evan_S1 Profile Picture
    341 on at

    @Devvj It needs to change based off of the status "closed" being selected. If I use what you mentioned it changes the time and date to the current time but the time and date should only change if "closed" is selected. The time and date should remain empty if any other status is showing.

  • Devvj Profile Picture
    1,132 Super User 2024 Season 1 on at

    @Evan_S1

    YYou could use a if() in the onchange property on the status field, something like

     

    If('your status field'.selected.text = "Closed", 'set all your fields to current date/time') 

  • Evan_S1 Profile Picture
    341 on at

    @Devvj 

     

    How would the "seta all your fields to current date/time" look in the function?

     

    If(DataCardValue61_3.Selected.Text = "Closed", (what function goes here?)

  • Devvj Profile Picture
    1,132 Super User 2024 Season 1 on at

    You can use a variable in the Default property on you date field, call it "varDate" or whatever you feel fit.

     

    Then your solution would look something like this

    If(DataCardValue61_3.Selected.Text = "Closed", Set(varDate, Now()), Set(varDate, Blank()))

     

    What it does is to check if the status field is set to closed and if it is, it sets the date field to current time, else it blanks out the date field instead.

  • Evan_S1 Profile Picture
    341 on at

    @Devvj 

     

    Then what function do I put in the date, hour, minutes ?

    Evan_S1_0-1698259925162.png

     

  • Devvj Profile Picture
    1,132 Super User 2024 Season 1 on at

    You can maybe reuse the same variable, just put the default property in the Hour field to "Hour(varDate)" and "Minute(varDate)" on the Minute field

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard