In Power Apps Make Choices
About the Author: Manish Luhana
Microsoft business applications specialist and certified trainer.
Categories: Dataverse, Power Platform0 CommentsPublished On: 24 December 2021

powerapps-forums

It happened to be the response to a question on one of the PowerApps forums about how to use the Dataverse Choice (OptionSet) field to display a dropdown containing the phrase “All.”

The Choices function returns a table of the lookup column’s potential values.

Use the Choices function to provide your user a list of options from which to choose.

datasource

It’s simple to combine the term “All” with the Items attribute of the dropdown when using SharePoint as a Datasource. However, while implementing Dataverse, things are different.

SharePoint

ClearCollect(
ColAllStatusSP,
{Value: “All”},Choices(SPList.ChoiceName)
);

Dataverse

Solution: As seen below, we have to loop over the Dataverse choice values.

ClearCollect(
ColAllStatus,
{Value: “All”}
);
ForAll(
Choices(GlobalChoiceName).Value,
Collect(
ColAllStatus,
{Value: Text(ThisRecord.Value)}
)
)

So, for the reason option will not fluctuate greatly, Collect and apply the values of the screen’s Onvisible parameter. You may need to filter the option field depending on use cases in some circumstances.

Summery

To include the word “All” in the Dataverse option field, we must loop through it and add it to the collection. You may utilize Concurrent to boost the page load performance.

tech mentor sidebanner
  • Continue reading
  • Continue reading
  • Continue reading
  • Continue reading
  • Continue reading

Leave A Comment