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.

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
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,557)