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

Top Kudoed Authors
Users online (2,857)