web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to add option set ...
Power Apps
Answered

How to add option set field value to new collection in Power Apps

(0) ShareShare
ReportReport
Posted on by 52

Dear all,

 

Struggling with the following.

 

In a Power App I'm creating a collection (collection_A) which is combining all quote products from different quotes together based on the fact that they have the same customer.

 

In the collection I want to add an option set field (ProductGroup) which is stored on the Product entity related to the Quote Product.

But I can't seem to find the right syntax to do this.

 

So I have Quote (entity) >

                          QuoteProduct (entity) >

                                                 Product (entity) - ProductGroup (option set)

 

The syntax I have now is the following:

 

ForAll(
 Quotes;
 ForAll(
 Filter(
 QuoteProducts;
 Quote.Quote = GUID(quote_id)
 );
 Collect(
 collection_A;
 {
 Quote_ID_A: Quote.Quote;
 QuoteProduct_A: QuoteProduct;
 QuoteProduct_Product_A: Product.Product;
 QuoteProduct_Product_ProductGroup_A: Product.ProductGroup
 }
 )
 )
)

 

 

I also tried to use a LookUp:

 

ForAll(
 Quotes;
 ForAll(
 Filter(
 QuoteProducts;
 Quote.Quote = GUID(quote_id)
 );
 Collect(
 collection_A;
 {
 Quote_ID_A: Quote.Quote;
 QuoteProduct_A: QuoteProduct;
 QuoteProduct_Product_A: Product.Product;
 QuoteProduct_Product_ProductGroup_A: LookUp(
 Products;
 Product = Product;
 ProductGroup
 )
 }
 )
 )
)

 

Doesn't work either.

 

Is there anybody who can tell me what the right syntax should be?

 

The datesource is CDS and the entities and fields are coming from Dynamics 365 CE

 

Appreciating the help!

 

Awaiting your response.

 

Best regards,

 

MWierckx

I have the same question (0)
  • Joel CustomerEffective Profile Picture
    3,224 on at

    when you say it doesn't work, what is it getting you? Is it getting you the options but not the labels? I recommend Michael G's post about option sets https://michalguzowski.pl/how-to-work-with-option-set-in-powerapps/

     

    If you can get the option set number value, there is a tool in the XrmToolBox (www.xrmtoolbox.com)  called the Power BI Option Set Assistant that is really helpful--it syncs all of the option sets in your environment to a an entity with the label and value for each, so you can join to that entity to translate number values to labels.

     

     

  • MWierckx Profile Picture
    52 on at

    Hi @jlindstrom,

     

    Thanks for the reply.

     

    I did found Michael his post about option sets, which was helpfull for me to filter in other action that I'm doing in the Power App. However it's not giving me the value or label of the selected option when retrieving the records to a new collection.

     

    Currently the syntax is giving an error, so nothing is happening.

     

    I'm not aware of the Power Bi option set Assistent, so I'll dive into that.

     

    I'll let you know if it works!

  • Verified answer
    v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @MWierckx ,

     

    Does the OptionSet Field allow Multi-selection?

    I made a test on my side, but it can work properly based on your code. Could you please share the error message on the code? 

    Snipaste_2020-06-30_17-06-07.png

    Sik

     

  • MWierckx Profile Picture
    52 on at

    @v-siky-msft,

     

    Thanks for the help, looking at your example I was able to figure out my mistake.

     

    Before excuting the Collect I have a ClearCollect in which I'm creating the table. During this creation I was telling the table that the option set column needed to be a text variable (which it isn't). 

    Sorry, stupid of me.

     

    Thanks again.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard