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 / Setting default items ...
Power Apps
Suggested Answer

Setting default items of a ComboBox that is tied to a table to values from a CSV

(2) ShareShare
ReportReport
Posted on by 67
Okay, this one is complicated so I'm sorry in advance and I will try to explain best I can. Any help is appreciated.
 
I currently have a dataverse table titled "Events". Each event has a column for users that are related to that event, which is simply a comma-separated list of user First and Last names. However, when the user is creating an event, that comma-separated list is being generated from a combobox tied to the "Users" table, that is then converted to a comma-separated list in the backend for storage. So again to walk through the process: the client goes to the event creation screen to create an event -> the client sees a combobox tied to the "Users" table, and can select multiple users from that table to tie to the event -> when the client creates the event, a power automate flow is run to create a dataverse table which enters those combo box choices as a comma-separated list.
 
This is all fine, but the issue comes when the user wants to edit this entry. Since it is stored as a comma-separated list, the editing field is just text. I know how to connect a combobox to the form to edit, but I need the default values of the combobox to line up with the comma separated list. Normally I would do this using Split() on the entry, but I don't believe this is possible because the items are linked with a dataverse table and not just text. So basically, I need a way to take a comma-separated list, query a dataverse table, and populate a combobox tied to that table with the items that match. Please let me know if there's a way to do this or if I need to explain anything further. Thanks again in advance for the help!
I have the same question (0)
  • Suggested answer
    WarrenBelz Profile Picture
    155,268 Most Valuable Professional on at
    Please refer to this blog of mine.
     
    DefaultSelectedItems should take the pattern
    Split(
       ThisItem.YourTextFieldName,
       ","
    )
    This assumes the DisplayFields is Value - there are are further options on the blog.
     
    Please ✅ Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn  
  • Suggested answer
    11manish Profile Picture
    2,126 on at
    Yes, you can populate the ComboBox by splitting the comma-separated string (as above suggested by )  and matching it against the Users table
     
    using Filter and Split functions.
     
    However, this approach is not ideal.
     
    The recommended solution is to replace the comma-separated field with a proper many-to-many relationship in Dataverse, which allows the ComboBox to work
     
    natively and avoids data consistency issues.
  • Suggested answer
    oyepanky Profile Picture
    527 on at

    Solution: Set DefaultSelectedItems from CSV in ComboBox (Dataverse)

    You can achieve this by converting your comma-separated string into a table and then matching it with your Dataverse Users table.

    Formula (Basic)  -  Set the DefaultSelectedItems property of your ComboBox to:
     

    Filter(
    
    Users,
    
    'Full Name' in Split(ThisItem.UserCSV, ",").Result
    
    )

    How It Works

    Split(ThisItem.UserCSV, ",") → Converts CSV text into a table

    .Result → Extracts individual values

    Filter(Users, ...) → Returns matching records from Dataverse

    ComboBox requires records, not text → this ensures correct binding

    Handling Extra Spaces (Recommended) > If your CSV values may contain spaces, use:

    Filter(Users, 'Full Name' in ForAll( Split(ThisItem.UserCSV, ","), Trim(Result)))

    Ensure 'Full Name' matches exactly with stored CSV values - This approach depends on text matching, so duplicates can cause issues

    Best Regards,
    Pankaj Jangid (OyePanky)
    Power Platform Developer
    Website: https://dialforit.com
    YouTube: https://www.youtube.com/@Oyepanky

  • AB-03121629-0 Profile Picture
    67 on at
    @11manish could you give a little insight into how to do this? I wasn't aware of a possibility to link the table entries without using a lookup table.
  • 11manish Profile Picture
    2,126 on at
     
    In Dataverse, a many-to-many (N:N) relationship between Events and Users allows you to associate multiple users with multiple events without storing comma-separated text. Dataverse manages this through an internal junction table, and in Power Apps you can directly bind a ComboBox to this relationship using SelectedItems and DefaultSelectedItems. 
     
    In Microsoft Dataverse:
    • Create N:N relationship:
    • Events ↔ Users
    Then:
    • Use ComboBox bound directly
    • No Split / Concat needed
    • Fully supported
  • AB-03121629-0 Profile Picture
    67 on at
    @11manish Ok got it, How can I manually set which users are set to which events? Where in dataverse can I go to say "relate these user rows in my user table to this one event in my events table" and how can I access that inside my powerapp?
  • 11manish Profile Picture
    2,126 on at
     
    To manually relate users to an event in Dataverse, you should create a many-to-many relationship between the Events and Users tables.
     
    You can then manage these relationships through a model-driven app using a subgrid where you add existing users to an event.
     
    In a Canvas App, you can access and manage this relationship directly using a ComboBox bound to the Users table, and save selections using Patch with
     
    SelectedItems.
     
    Dataverse handles the relationship automatically without needing manual string manipulation.
  • AB-03121629-0 Profile Picture
    67 on at
    @11manish so let's say this combobox exists inside of a form, where I have a button that's submitting the rest of the form updates to the Event item. Would I use the Patch function on the same button that submits the rest of the forms? And if so, what's the syntax that I need to use for that? I recognize the record that I need to update is the row item Event, but I'm not sure what to put for the "Update" parameter. And also, I still don't know how I would populate the default selected items.
     
    Right now, I am trying to use the patch function on the same OnSelect code block of my save button as follows. 
     
    Patch('Events', activeEvent.event_users, UserEditCombo.SelectedItems)
     
    Where Events is the event table, activeEvent is the item that the user is currently editing, and userEditCombo is the combobox we mentioned. This is throwing an error that it is expecting a Record and not Text. Please help me fix!

    And again, how can I use this to populate the default selected items?
     
    Thanks so much.
  • 11manish Profile Picture
    2,126 on at
     
    You are so close.
     
    Right now you’re doing:
    • Patch('Events', activeEvent.event_users, UserEditCombo.SelectedItems)
    Problem:
    • activeEvent.event_users is not a record, it’s a field (and likely a table/text)
    Patch expects:
    • Patch(DataSource, Record, { field: value })

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 936

#2
11manish Profile Picture

11manish 628

#3
Valantis Profile Picture

Valantis 604

Last 30 days Overall leaderboard