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 / Add two options to a c...
Power Apps
Unanswered

Add two options to a choice (Option set) column using a collection

(0) ShareShare
ReportReport
Posted on by 1,712

Hello everyone,

I have a status choice field in a table in dataverse that has some values and I would like to add two extra options to a choice (Option set) column using a collection in Power Apps canvas.

I have tried the below:
ErrorAddAnOption.png

When I add a string to the value parameter the formula highlights an error. If I keep the Blank() function it is working but it seems that the choice (option set) is expecting a different data type?

Blank()Blank()
The SharePoint Choice column is very straight forward and it doesn't throw an error:
SharePoint status column.png

What should be the updated formula in order to add two or more options for a choice (option set) column? Can please someone provide an example?

Any help is highly appreciated.

Thank you!

Categories:
  • AJ_Z Profile Picture
    3,711 Super User 2024 Season 1 on at

    I usually add more in the source e.g. the sharepoint site but what happens when you wrap square brackets around it e.g. {Value:["Pending"]},{Value:["All"]}. 

  • EBMRay Profile Picture
    1,712 on at

    Hello @AJ_Z,
    I also do the same by adding more options to the source but for my scenario, I just want to filter the data in the gallery by populating the choices option and I am trying that option to learn something new by adding an option value using the choice (option set) field using a collection.
    I wrapped square brackets around value but it is still showing the same error:
    Capture.PNG
    What might be the trick to make it work?
    I look forward to your response.
    Thank you!

  • AJ_Z Profile Picture
    3,711 Super User 2024 Season 1 on at

    Apologies I misread your post. For something like this I make the collection usually:

    ForAll(Choices('Time Entries'.'Approval Status'),Collect(colChoices,{Value:ThisRecord.Value}));Collect(colChoices,{Value:Blank()},{Value:"Pending"},{Value:"All"});

     

    then i make the items in a combobox usually into the collection name which in this case is as colChoices

  • EBMRay Profile Picture
    1,712 on at

    Hello @AJ_Z ,

    Thank you for your reply.
    I have tried the below formula that you mentioned and I got the same error:
    Screenshot 2022-01-18 085419.png
    What is wrong with the formula?
    Thank you!

  • AJ_Z Profile Picture
    3,711 Super User 2024 Season 1 on at

    My initial thoughts with this regarding errors are conflicting names 🙂 

     

    perhaps try changing it to:

     

    ForAll(Choices('Time Entries'.'Approval Status'),Collect(colChoices1,{Value:ThisRecord.Value}));Collect(colChoices1,{Value:Blank()},{Value:"Pending"},{Value:"All"});

     

    if no joy with that try to see what options appear after ThisRecord i would expect it to be value but it could be something else. So when you go back to ThisRecord the area in red below type in the "." and see what options come after I am expecting it to be Value but it could be something else.

     

    ForAll(Choices('Time Entries'.'Approval Status'),Collect(colChoices1,{Value:ThisRecord.Value}));Collect(colChoices1,{Value:Blank()},{Value:"Pending"},{Value:"All"});

     

    As part of trouble shooting try the two steps separately on diff buttons maybe? e.g.

     

    Collect(colChoices1,{Value:Blank()},{Value:"Pending"},{Value:"All"}); on one and

    ForAll(Choices('Time Entries'.'Approval Status'),Collect(colChoices1,{Value:ThisRecord.Value})) on the other.

     

    let me know how this goes. My initial thought is that there were already values in colChoices so i am suggesting trying colChoices1. If this doesn't work let me know 🙂 ?

  • EBMRay Profile Picture
    1,712 on at

    Hello @AJ_Z ,

    Thank you for your reply and for providing an example.

    I have tried all the steps mentioned with no hope.
    Screen1.png
    After ThisRecord the option is .Value which is the right one that we're using.

    For troubleshooting I have added two separate buttons:

    When I added the second button that has the below line of formula, both formulas fails with an error:
    Screen2.pngScreen3.png

    It is really strange why it is not working.

    I look forward to your response.
    Best regards,
    Julien

  • EBMRay Profile Picture
    1,712 on at

    Hello @AJ_Z ,

    I have used "ThisRecord" instead of "Value" as the key and it worked 😀.
    Screen1.PNGScreen2.PNG

    I don't know if this is the right solution but I ended up getting this formula in this way.
    Please let me know if it is the right solution.

    Thank you!

     

  • AJ_Z Profile Picture
    3,711 Super User 2024 Season 1 on at

    It doesn't look as I expected does it give you all the values you needed from choices?

  • EBMRay Profile Picture
    1,712 on at

    Hi @AJ_Z ,

    Yes, it gives me all the values needed from the choice, please find the below screenshots:
    Screenshot 2022-01-20 170518.pngOptionValues.png
    But I still didn't understand how did it work 😂.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard