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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Assigning a array of i...
Power Apps
Unanswered

Assigning a array of items to a Modern dropdown control

(0) ShareShare
ReportReport
Posted on by 13

I'm hoping someone can help me troubleshoot this issue. I'm trying to assign a set of values in an array to a Modern dropdown control but I get this error message after the equal sign (=) is underlined with the RED squealy line;

Incompatible types for comparison. These Types can't be compared: Table, Table.

I would imagine that Table values should rather be comparable

The PowerFX line of Code is as follows;  drpMon_1.SelectedItems = [ "Item1", "Item2" , "Item3" ]

 

I've also attached the actual screenshot here. 

Any ideas or alternatives to achieving this will be greatly appreciated.

 

Categories:
I have the same question (0)
  • BCLS776 Profile Picture
    8,994 Moderator on at

    Are you trying to pre-populate the combobox with several selections? If so, put your array(table) in the DefaultSelectedItems property of the combobox, ensuring that the schema of the table records match the schema of the Items property of the combobox.

     

    Hope that helps,

    Bryan

  • dougydoe Profile Picture
    13 on at

    Hi Bryan, 
    Thanks for reaching out.
    I've already pre-populated the Dropbox in the DefaultSelectedItem which is fine. However, I'm now trying to update the dropdown when a certain condition is met elsewhere. So,  sort of trying to update it programmatically. Hope that makes sense. 

  • BCLS776 Profile Picture
    8,994 Moderator on at

    I'm not quite sure what you mean by "update" the dropdown, but you can put conditional logic into the Items property so that different versions of the underlying table are shown in different circumstances. An If() or Switch() statement often works in those situations.

     

    Bryan

  • dougydoe Profile Picture
    13 on at

    The conditional logic is elsewhere in the app such that, when a condition is met, I want the dropdown to be dynamically repopulated with new items. The Item property is initially populated from a choice column in a SharePoint List using the Choice Function. I'm assuming that is possible in PowerFx

  • BCLS776 Profile Picture
    8,994 Moderator on at

    @dougydoe wrote:

    The conditional logic is elsewhere in the app such that, when a condition is met, I want the dropdown to be dynamically repopulated with new items. The Item property is initially populated from a choice column in a SharePoint List using the Choice Function. I'm assuming that is possible in PowerFx


    Yes, this is possible, and keep in mind the schema of the different options for the Items property will need to match to avoid issues. For example, if the dropdown uses a single-column table with a field name of "Value", make sure the other options provide the same.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard