cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ICM
Level: Powered On

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 Team
Community Support Team

Re: Update a timestamp & username when radio selection changes

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

ICM
Level: Powered On

Re: Update a timestamp & username when radio selection changes

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 Team
Community Support Team

Re: Update a timestamp & username when radio selection changes

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

ICM
Level: Powered On

Re: Update a timestamp & username when radio selection changes

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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,635)