cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ICM
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
v-monli-msft
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
v-monli-msft
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.

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. 

Helpful resources

Announcements
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.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,999)