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 an option to Choic...
Power Apps
Answered

Add an option to Choices Column

(0) ShareShare
ReportReport
Posted on by 49

Hi folks, 

How can i add option "All" to that choice columns 

notitle1.png

 

notitle2.png

I tried doing it this way but it's only works on sharepoint lists. I'm using a dataverse table and its says "The given types are incompatible"

ClearCollect(
 colSubject,
 {Value: "All"},
 Choices(Students.Subject)
);

 

Categories:
  • kelseytran Profile Picture
    292 on at

    Hi @Pabblo_96 ,

    Try this: 

     

    ClearCollect(
     colOptions,
     {Value: "All"},
     YourDataverseTableName.FieldName
    );

     

    Replace the last line with the name of your data, then use that collection in the Items property of your dropdown:

     

    Items: colOptions

    ------------------------------------------------------------------------------------------------------------------------------
    If I answered your question, please accept my post as a solution and if you liked my response, please give it a thumbs up.

    Thanks!

     

  • Pabblo_96 Profile Picture
    49 on at

    Your option will give me all of the subjects that i have in column "Subject"  (20 records with e.g. 6x English, 8x Maths and 6x Geography). I can use "Distinct" function but it's still get error with incompatible types

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Pabblo_96,

     

    The error occurs due to the 'All' record not having the same structure as the Dataverse choice column. We can add an additional option by looping through the Dataverse option set and matching that record schema. This approach will, however, also require some changes to your Filter statement.

     

    (1) Add 'All' to your dropdown

    //Option 1 -> create a collection e.g. in the App.Onstart and use that collection as your dropdown items property
    ClearCollect(
     colSubject,
     {Value: "All"},
     ForAll(
     Choices(Students.Subject),
     {Value: Text(ThisRecord.Value)}
     )
    );
    
    //Option 2 - use the code below in the Items property of your dropdown (use option 1 if you need this choice list across multiple dropdowns / screens)
    //Ungroup nested table structure (merge tables)
    Ungroup(
     [
     [{Value: "All"}],
     ForAll(
     Choices(Students.Subject),
     {Value: Text(ThisRecord.Value)}
     )
     ],
     "Value"
    )
    

     

    (2) Change Filter condition that references the choice column

     

    Due to the record schema adjustment, your filter conditions referencing this dropdown will result in an 'incompatible type' error. We can resolve this by creating a mapping to the correct choice via the With & Switch functions:

    With(
     {
     wChoice: Switch(
     //Change 'DropdownName'
     DropdownName.Selected.Value,
     "English",
     //Should the choice name not be recognized - see comment below this code block
     'Subject (Students)'.'English',
     "Maths",
     'Subject (Students)'.'Maths',
     "Geography",
     'Subject (Students)'.'Geography'
     )
     },
     Filter(
     Students,
     //Change 'DropdownName'
     //Filter by choice if 'All' is not selected
     DropdownName.Selected.Value = "All" || Subject = wChoice
     )
    )

    The name of your choice column will vary depending on whether you sync your choice set (see column settings). Should they be synced then you will have to replace 'Subject (Students)' with the name provided for that choice set.

     

    LaurensM_0-1709145330833.png

    The code block above expects 'No' to be selected. In this case the name will have the following structure:

    'ColumnName (TableName)'

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

  • Pabblo_96 Profile Picture
    49 on at

    Thank you, it's working this is what I'm looking for.

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 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard