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

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

Highlighted
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

Highlighted

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,

Highlighted

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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,428)