cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Community Support
Community Support

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

Highlighted
Advocate II
Advocate II

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

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

Highlighted
Advocate II
Advocate II

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,031)