cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RCSmart01
Microsoft
Microsoft

Update Text field with current time

i am trying to update a text field with the current time and date when a checkbox is checked.  I have tried to use onselect of button to do that but the formula i am using is not working properly. Then i want to update the record in my SQL database that the information is coming from. How would i make this possible?

2 REPLIES 2
v-micsh-msft
Community Support
Community Support

Hi @RCSmart01,

 

Could you please share more details about how you would like to update the record in your SQL Database?

I will share an example here, about how to show the current time in a Label control when CheckBox checked.

1. Add a Label control, add a CheckBox control,

2. Under text property of the Label control, enter the following:

If(Checkbox1.Value=true,Now())

In this way, when the CheckBox is checked, the Label would show the current date and time.

If you would like to update the record in SQL Database with the current time, then you cuold take use of the patch function:

For example:

Patch(TableName, RecordNeedtoModify, {UpdatedRecordItem})

For the details usage of the patch() function, please check:

Patch function in PowerApps

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for the reply, i want to apologize for i gave you wrong info, the field i want to update is a date/time field. Thanks for the patch function i am going to read on that and see if it is what i want.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,884)