cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate II
Advocate II

Update a timestamp & username when radio selection changes

Hi all,

 

I have a timestamp and username field that I want to update on selection/change of a radio button list.

i.e. I have a radio button list with 4 options. Whenever one of the radio buttons is selected, I want the timestamp text box to update to the current date and time and a username textbox to update to the current user name.

 

Any ideas on how I might achieve this?

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support
Community Support

Hi @ICM,

 

Let me explain my understanding for your requirement. You want that, no matter which of the 4 options in radio is selected, you want a text box with timestamp to update to current data and time, and a username textbox to update to the current user name. 

 

If this is the situation, Then you just need to set the Text property of the Label control to this formula:

 

If("Test1" in Radio1.Selected.Value, Text( Now(), "[$-en-US]mm/dd/yyyy hh:mm:ss" ),"Test2" in Radio1.Selected.Value, Text( Now(), "[$-en-US]mm/dd/yyyy hh:mm:ss" ),"Test3" in Radio1.Selected.Value, Text( Now(), "[$-en-US]mm/dd/yyyy hh:mm:ss" ) ,"Test4" in Radio1.Selected.Value, Text( Now(), "[$-en-US]mm/dd/yyyy hh:mm:ss" ),"Timestamp")

 

 

Then Text property of the username Label control to:

If("Test1" in Radio1.Selected.Value, User().FullName,"Test2" in Radio1.Selected.Value, User().FullName,"Test3" in Radio1.Selected.Value, User().FullName ,"Test4" in Radio1.Selected.Value, User().FullName,"Timestamp")

Capture.PNG

 

For your reference:

Now, Today, and IsToday functions in PowerApps

https://docs.microsoft.com/en-us/powerapps/functions/function-now-today-istoday

User function in PowerApps

https://docs.microsoft.com/en-us/powerapps/functions/function-user

 

Regards,

Mona

 

 

Community Support Team _ Mona Li
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

Hi @v-monli-msft,

 

thanks for this, but I finally solved this last thing yesterday.

 

I simply set the "Default" property of the Timestamp textbox to

 

if(radio1.selected.value<>"", Text( Now(), "[$-en-US]mm/dd/yyyy hh:mm:ss" )

and the "Default" property of the Username textbox to

 

if(radio1.selected.value<>"", user().fullname )

 

which did exactly what I wanted, so whenever anyone makes a selection it updates the timestamp and username.

 

Thank you for your reply. 

View solution in original post

2 REPLIES 2
Community Support
Community Support

Hi @ICM,

 

Let me explain my understanding for your requirement. You want that, no matter which of the 4 options in radio is selected, you want a text box with timestamp to update to current data and time, and a username textbox to update to the current user name. 

 

If this is the situation, Then you just need to set the Text property of the Label control to this formula:

 

If("Test1" in Radio1.Selected.Value, Text( Now(), "[$-en-US]mm/dd/yyyy hh:mm:ss" ),"Test2" in Radio1.Selected.Value, Text( Now(), "[$-en-US]mm/dd/yyyy hh:mm:ss" ),"Test3" in Radio1.Selected.Value, Text( Now(), "[$-en-US]mm/dd/yyyy hh:mm:ss" ) ,"Test4" in Radio1.Selected.Value, Text( Now(), "[$-en-US]mm/dd/yyyy hh:mm:ss" ),"Timestamp")

 

 

Then Text property of the username Label control to:

If("Test1" in Radio1.Selected.Value, User().FullName,"Test2" in Radio1.Selected.Value, User().FullName,"Test3" in Radio1.Selected.Value, User().FullName ,"Test4" in Radio1.Selected.Value, User().FullName,"Timestamp")

Capture.PNG

 

For your reference:

Now, Today, and IsToday functions in PowerApps

https://docs.microsoft.com/en-us/powerapps/functions/function-now-today-istoday

User function in PowerApps

https://docs.microsoft.com/en-us/powerapps/functions/function-user

 

Regards,

Mona

 

 

Community Support Team _ Mona Li
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

Hi @v-monli-msft,

 

thanks for this, but I finally solved this last thing yesterday.

 

I simply set the "Default" property of the Timestamp textbox to

 

if(radio1.selected.value<>"", Text( Now(), "[$-en-US]mm/dd/yyyy hh:mm:ss" )

and the "Default" property of the Username textbox to

 

if(radio1.selected.value<>"", user().fullname )

 

which did exactly what I wanted, so whenever anyone makes a selection it updates the timestamp and username.

 

Thank you for your reply. 

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (89,523)