
I have a basic ClearCollect(allReports, Reports) on start.
When I run on start and look at what is gathered, it gathers all the fields I need except the Option Set ones?
If I just use the table and pull into a gallery it pulls in all fields and option sets.
How can I get the Collection to also pull those in?
Thanks,
Terry
Hi @Mattw112IG
Option sets are a type of complex data type that store both a numeric value and a text label for each option. When you use ClearCollect to collect data from a Dataverse table, it only collects the simple data types, such as text, number, date, etc. It does not collect the complex data types, such as option sets, lookups, images, etc.
To collect the option set fields, you need to use the AsType function to convert them to simple data types.
For example, if you have an option set field called ProductGroup in your Reports table, you can use this formula:
ClearCollect(allReports, ShowColumns(Reports, "ProductGroup".AsType()))
You can also collect multiple fields at once by using commas to separate them in the ShowColumns function.
ClearCollect(
allReports,
ShowColumns(
Reports,
"Name",
"Date",
"ProductGroup".AsType()
)
)
If you have any questions or feedback, please let me know. Have a great day! 😊
-----------------------
PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]
I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻