exam questions

Exam PL-200 All Questions

View all questions & answers for the PL-200 exam

Exam PL-200 topic 2 question 7 discussion

Actual exam question from Microsoft's PL-200
Question #: 7
Topic #: 2
[All PL-200 Questions]

You have a canvas app that allows users to view, select, and purchase products. The app uses a Gallery control to display products and checkboxes that allow users to select products.
When users select items from the product catalog, they move to a different screen to complete a purchase.
Users must be able to clear all product selections when they click the button.
You need to configure the button.
What should you do?

  • A. Use the Reset(Control) formula and pass the gallery control as a parameter to the Reset formula.
  • B. Use the Reload(Control) formula and pass the gallery control as a parameter to the Reload formula.
  • C. Use the ForAll() function to iterate through each item of the Gallery and clear user selections.
  • D. Set the OnCheck value to populate a collection and the OnUncheck value to remove the item from the collection. Clear collection when the user selects the button.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Kalki602
Highly Voted 4 years, 3 months ago
Answer is D, 100%. The very same example is part of App in a day training, Canvas app module, page 28, to be very specific. It clearly says: select the Checkbox control and click on the Action tab in the ribbon, click OnCheck and set value in the formula bar to: Collect (CompareList, ThisItem). Set the OnUncheck value to Remove(CompareList, ThisItem). This is required to make sure the unchecked items are removed from the collection”
upvoted 85 times
HassanSarhan
4 years ago
Right, thank you!
upvoted 1 times
...
baughfell
4 years, 3 months ago
Agreed D 100% You cannot reset controls that are within a Gallery or Edit form control from outside those controls https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-reset
upvoted 9 times
...
AndreaDP
3 years, 2 months ago
I agree with the logic for unchecking each element. However (this is very recurring with these low quality questions) the question asks to place a "button" to reset the entire gallery not to uncheck individual elements. I'll stay with the response D.
upvoted 4 times
AndreaDP
3 years, 2 months ago
Sorry...with response A!
upvoted 2 times
WingsAreKing
2 years, 9 months ago
Have you actually tried doing this? Create a gallery, attach it to a datasource, insert checkboxes, check some of them. Use a button outside of the gallery to Reset(Gallery1). What happens? Nothing. Because that's not how you reset individual controls in a gallery. D is the only viable option because of the above. Try it yourself.
upvoted 5 times
...
...
...
ZVV
4 years, 2 months ago
But how we clear the Gallery control checkboxes after we clear Collection?
upvoted 6 times
Maarten76
3 years, 5 months ago
On the Checkboxes Default property, set a formula to check if the item is in the collection: ThisItem in CompareList (where CompareList is just the name of the collection) Now, when you do a Clear(CompareList) on the button (OnSelect), the checkboxes will be cleared.
upvoted 4 times
...
HJLN
1 year, 9 months ago
"Users must be able to clear all product selections when they click the button." not asking to clear the checkboxes
upvoted 1 times
...
charles879987
2 years, 1 month ago
Exactly. Answer D do not uncheck the checkboxes. Why so many upvotes?
upvoted 3 times
...
...
...
K221133
Highly Voted 4 years, 4 months ago
correct
upvoted 19 times
...
Tootru2bReal
Most Recent 6 months ago
Selected Answer: A
I normally do not reply to these but I can see where the confusion is. But Answer A is the correct choice. According to the documentation (Microsoft Docs on Gallery Control): Reset() works with a Gallery control by iterating through all the child controls inside the Gallery and resetting them to their default values. This means you can reset all checkboxes within the Gallery by simply passing the Gallery control to the Reset() function. You just need to ensure the 'Default property of the checkbox is set to false. D is definitely not correct as it only pertains to a collection. If anyone has been creating apps for years they will discover this. For those that said nothing happened, more than likely there was a problem with your code, not the formula function. Also, for added reference, you can view this video as well: (and this is from 3 years ago lol). https://www.youtube.com/watch?v=691pRyRHWBU
upvoted 2 times
...
emily_kris
10 months, 1 week ago
Selected Answer: D
Agree with Kalki602
upvoted 1 times
...
5f14337
10 months, 2 weeks ago
Selected Answer: D
D. Set the OnCheck value to populate a collection and the OnUncheck value to remove the item from the collection. Clear the collection when the user selects the button. This approach ensures that you have a collection tracking the selected items, and you can easily clear this collection when needed, effectively resetting the selections.
upvoted 1 times
...
HAZZTA
11 months, 2 weeks ago
Answer A. The question is very specific - It asks you to add a button that rests that clears product selections when the button is clicked, not what what the entire process of adding and removing items should be. I think this is a clear case of answering the question, not providing a solution to the preamble.
upvoted 1 times
Bili94
11 months ago
I think you don't need to put comments under the questions because yours answers doesn't help, rather you are misleading people!!!!!
upvoted 1 times
...
...
hismail
1 year, 5 months ago
Selected Answer: A
In Power Apps, the Reset function is used to reset a control to its default value. In this case, you want to clear all product selections in the gallery control when the user clicks a button. By passing the gallery control as a parameter to the Reset function, you can achieve this. The Reset function will reset all controls within the gallery, including the checkboxes, effectively clearing all product selections. The other options are not appropriate for this scenario: B. The Reload function does not exist in Power Apps. C. The ForAll function could be used to iterate through each item in the gallery, but it would be more complex and less efficient than using the Reset function. D. While you could use the OnCheck and OnUncheck properties to manage a collection of selected items, this would not directly affect the selections in the gallery control itself. Clearing the collection would not uncheck the checkboxes in the gallery.
upvoted 4 times
...
TwelveConsulting
1 year, 7 months ago
I would go with C, as it allows to patch information directly to the Table / Collection with the proper functions put afterwards. A does not work at all when I test it. D does not clear all values, so it does not answer the question.
upvoted 1 times
...
anakinskwlkr
1 year, 8 months ago
Its clearly A. This question specifically states: " Users must be able to clear all product selections when they click the button. YOU NEED TO CONFIGURE TE BUTTON" D is a bunch of steps to configure all the actions, but its not what the question is asking.
upvoted 1 times
...
wsjones
1 year, 10 months ago
on test - 8/1/23
upvoted 2 times
...
vunguyen97
1 year, 10 months ago
"Users must be able to clear all product selections when they click the button." While D makes sense, A is actually the final answer to solve this one. The previous line about go to next page for purchases is also irrelevant to the real question. Be careful guys!
upvoted 2 times
...
JalapenoJun
1 year, 11 months ago
Selected Answer: D
I tried this - and D is the answer. Tried A nothing happened
upvoted 2 times
...
charles879987
2 years, 1 month ago
Selected Answer: A
A is correct. D is not correct. Clearing collection do not uncheck the checkbox selections. It has to be done by reset.
upvoted 1 times
...
RazielLycas
2 years, 6 months ago
Selected Answer: D
I vote D for president
upvoted 5 times
...
allesglar
2 years, 7 months ago
Selected Answer: D
I will go with D
upvoted 1 times
...
SGTEST
2 years, 8 months ago
Selected Answer: A
Reset can be used like this https://thepoweraddict.com/resetting-a-gallery-in-power-apps/
upvoted 2 times
...
stanley_ipkis
2 years, 8 months ago
Selected Answer: D
D for sure!
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...