cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GarretBaker
Regular Visitor

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
v-xida-msft
Community Support
Community Support

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

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

v-xida-msft
Community Support
Community Support

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

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,

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

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,253)