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

Checkbox or Toggle edited by and when

I am creating a checklist that could either use a checkbox or toggle. My goal is when a user checks off that item by clicking the toggle I want a label to display that said user checked off this edit and the date when they checked it off. I attached a picture of what I have so far. 

 

I am using sharepoint list as my data source and I dont quite understand the modifed by

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Checkbox or Toggle edited by and when

Hi @GarretBaker,

 

Could you please share a bit more about your scenario?

Do you mean that you don't know how to get the date time when the end user check it off?

Further, could you please share a screenshot about your app's configuration?

 

I assume that you display your SP list items within a Gallery control, I have made a test on my side, please take a try with the following workaround:1.JPG

 

2.JPG

 

 

Set the Items property of the Gallery control to following fomrula:

'20180907_case9'

Note: The '20180907_case9' represents the SP list data source within my app.

 

Within the Gallery control, set the OnCheck property of the Toggle control to following formula:

Collect(
CheckCollection,
{
LabelText:"Checked off by "&User().FullName&" at"&Now(),
ItemID:ThisItem.ID
}
)

Set the Text property of the Label control to following formula:

LookUp(CheckCollection,ItemID=ThisItem.ID,LabelText)

The GIF screenshot as below:Test1.gif

 

 

In addition, I also agree with @ThatAPIGuy's thought almost, you could consider take a try to store the value (Label text value) into your SP list data source. 

 

I assume that there is a column called LabelText (Single line of text) within your SP list, if you want to store the Label text value within your SP list, please modify the OnCheck property of the Toggle control within the Gallery as below:

Patch(
CheckCollection,
LookUp(CheckCollection,ID=ThisItem.ID),
{
LabelText:"Checked off by "&User().FullName&" at"&Now()
}
);
Patch('YourSPList',ThisItem,{LabelText:"Checked off by "&User().FullName&" at"&Now()})

Set the OnVisible or OnStart property of the first screen of your app to following formula:

ClearCollect(CheckCollection,'YourSPList')

More details about Patch function in PowerApps, please check the following article:

Patch function

 

Best regards,

Kris

Community Support Team _ Kris Dai
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

4 REPLIES 4
Super User
Super User

Re: Checkbox or Toggle edited by and when

@GarretBaker

 

First, insert a label and set its Text property to LabelText.

 

Then, you can use this formula in the OnCheck property of the toggle -

UpdateContext({LabelText:"Checked by "&User().FullName&" at "&Now()}) 

2018-09-13 14_10_13-App - PowerApps.png

 

 

2018-09-13 14_10_31-PIM Progress Tracking - Lee Teare Format.xlsx  [Read-Only] - Excel.png 

2018-09-13 14_10_57-App - PowerApps.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I am assuming that you als want to update this in a column in the sharpoint list. For that, In the Oncheck property , use this -

UpdateContext({LabelText:"Checked by "&User().FullName&" at "&Now()}) ;Patch(SharepointListName, SelectedRecord,{CheckedOff:Label.Text})

Hope this helps.


Vivek Bavishi aka That API Guy
PowerApps and Flow MVP
Blog | Twitter | YouTube | Community Profile | GitHub



If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team
Community Support Team

Re: Checkbox or Toggle edited by and when

Hi @GarretBaker,

 

Could you please share a bit more about your scenario?

Do you mean that you don't know how to get the date time when the end user check it off?

Further, could you please share a screenshot about your app's configuration?

 

I assume that you display your SP list items within a Gallery control, I have made a test on my side, please take a try with the following workaround:1.JPG

 

2.JPG

 

 

Set the Items property of the Gallery control to following fomrula:

'20180907_case9'

Note: The '20180907_case9' represents the SP list data source within my app.

 

Within the Gallery control, set the OnCheck property of the Toggle control to following formula:

Collect(
CheckCollection,
{
LabelText:"Checked off by "&User().FullName&" at"&Now(),
ItemID:ThisItem.ID
}
)

Set the Text property of the Label control to following formula:

LookUp(CheckCollection,ItemID=ThisItem.ID,LabelText)

The GIF screenshot as below:Test1.gif

 

 

In addition, I also agree with @ThatAPIGuy's thought almost, you could consider take a try to store the value (Label text value) into your SP list data source. 

 

I assume that there is a column called LabelText (Single line of text) within your SP list, if you want to store the Label text value within your SP list, please modify the OnCheck property of the Toggle control within the Gallery as below:

Patch(
CheckCollection,
LookUp(CheckCollection,ID=ThisItem.ID),
{
LabelText:"Checked off by "&User().FullName&" at"&Now()
}
);
Patch('YourSPList',ThisItem,{LabelText:"Checked off by "&User().FullName&" at"&Now()})

Set the OnVisible or OnStart property of the first screen of your app to following formula:

ClearCollect(CheckCollection,'YourSPList')

More details about Patch function in PowerApps, please check the following article:

Patch function

 

Best regards,

Kris

Community Support Team _ Kris Dai
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

GarretBaker
Level: Powered On

Re: Checkbox or Toggle edited by and when

The only thing now that might help and I haven't had time to look at is reseting the label text to nothing when someone changes the toggle back to false. Maybe a hide or something,

GarretBaker
Level: Powered On

Re: Checkbox or Toggle edited by and when

I found out that "clear(collection)" does this trick and I set that in the "uncheck" property 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 154 members 5,289 guests
Please welcome our newest community members: