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
Solved! Go to Solution.
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:
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:
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:
Best regards,
Kris
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()})
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.
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:
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:
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:
Best regards,
Kris
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
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
270 | |
252 | |
86 | |
37 | |
33 |
User | Count |
---|---|
343 | |
263 | |
129 | |
68 | |
45 |