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 / Filtering a datasource...
Power Apps
Answered

Filtering a datasource if a text field of elements separated by commas is found in a ComboBox Selected Items

(0) ShareShare
ReportReport
Posted on by 137

Hi,

 

So basically I have a text field like this: 'A, B, C,' and a combobox with many choices A, B, C, D, etc, I want to filter a datasource if the selecteditems of the combobox are contained in the text field. ie. the text field is 'A, B' if th user chooses A or B that record should appear, if the user chooses something else, the record should not appear.

 

Contain, Match and InStr appeared to be unknown inside the filter

 

Thanks

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,293 Most Valuable Professional on at

    Hi @carlosguzmanbpa ,

    You would need something like this assuming the Combo Box is multi-selection.

    Ungroup(
     ForAll(
     ComboBox.SelectedItems As _Data,
     Filter(
     DataSource,
     _Data.Value in YourTextField
     )
     ),
     "Value"
    )

     

    Please click Accept as solution 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 giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • carlosguzmanbpa Profile Picture
    137 on at

    What does the ungroup do in this context?

     

  • carlosguzmanbpa Profile Picture
    137 on at

    @WarrenBelz because the data source i am using has many AddColumns in it and other filters from other comboboxes

  • WarrenBelz Profile Picture
    156,293 Most Valuable Professional on at

    @carlosguzmanbpa ,

    Can you please provide your full code in Text.

  • carlosguzmanbpa Profile Picture
    137 on at

    @WarrenBelz 

     

    Filter(
    AddColumns(
    'Superior - Solicitudes',
    "CorreoAprobador",
    LookUp(
    AddColumns(
    'Superior - Trabajadores',
    "CorreoAprobador",
    LookUp(
    'Superior - Aprobadores',
    ID = 'Superior - Trabajadores'[@AprobadorID],
    Correo
    )
    ),
    ID = 'Superior - Solicitudes'[@IDTrabajador],
    CorreoAprobador
    ),
    "NombreTrabajador",
    LookUp(
    'Superior - Trabajadores',
    ID = 'Superior - Solicitudes'[@IDTrabajador],
    Nombre.Value
    ),
    "DocumentoTrabajador",
    LookUp(
    'Superior - Trabajadores',
    ID = 'Superior - Solicitudes'[@IDTrabajador],
    Documento.Value
    ),
    "RHTrabajador",
    LookUp(
    'Superior - Trabajadores',
    ID = 'Superior - Solicitudes'[@IDTrabajador],
    RH.Value
    ),
    "CorreoTrabajador",
    LookUp(
    'Superior - Trabajadores',
    ID = 'Superior - Solicitudes'[@IDTrabajador],
    Correo
    ),
    "CargoTrabajador",
    LookUp(
    'Superior - Trabajadores',
    ID = 'Superior - Solicitudes'[@IDTrabajador],
    Cargo.Value
    ),
    "Base",
    LookUp(
    'Superior - Trabajadores',
    ID = 'Superior - Solicitudes'[@IDTrabajador],
    Base.Value
    ),
    "BLTrabajador",
    LookUp(
    'Superior - Trabajadores',
    ID = 'Superior - Solicitudes'[@IDTrabajador],
    BusinessLine.Value
    ),
    "AreaTrabajador",
    LookUp(
    'Superior - Trabajadores',
    ID = 'Superior - Solicitudes'[@IDTrabajador],
    Area.Value
    ),
    "ZonaCorporal",
    Concat(
    Filter(
    'Superior - EPPs por Solicitud',
    IDOrden = 'Superior - Solicitudes'[@ID]
    ), ZonaCorporal.Value &", "
    ),
    "NombreEPP",
    Concat(
    Filter(
    'Superior - EPPs por Solicitud',
    IDOrden = 'Superior - Solicitudes'[@ID]
    ), NombreEPP &", "
    )
    ),

    IsBlank(ComboBox2_5.SelectedItems.Value) || IsEmpty(ComboBox2_5.SelectedItems) || Estado in ComboBox2_5.SelectedItems,
    IsBlank(DatePicker2.SelectedDate) || Text(
    Fecha,
    DateTimeFormat.ShortDate
    ) = Text(
    DatePicker2.SelectedDate,
    DateTimeFormat.ShortDate
    ),
    IsBlank(ComboBox2_4.SelectedItems.Value) || IsEmpty(ComboBox2_4.SelectedItems) || NombreTrabajador in ComboBox2_4.SelectedItems.Value,
    IsBlank(ComboBox12.SelectedItems.Value) || IsEmpty(ComboBox12.SelectedItems) || ID in ComboBox12.SelectedItems,
    IsBlank(ComboBox9.SelectedItems.Value) || IsEmpty(ComboBox9.SelectedItems) || Base in ComboBox9.SelectedItems.Value,
    IsBlank(ComboBox5.SelectedItems.Value) || IsEmpty(ComboBox5.SelectedItems) || DocumentoTrabajador in ComboBox5.SelectedItems.Value,
    IsBlank(ComboBox3.SelectedItems.Value) || IsEmpty(ComboBox3.SelectedItems) || CorreoTrabajador in ComboBox3.SelectedItems.Value,
    IsBlank(ComboBox4.SelectedItems.Value) || IsEmpty(ComboBox4.SelectedItems) || BLTrabajador in ComboBox4.SelectedItems.Value,
    IsBlank(ComboBox11.SelectedItems.Value) || IsEmpty(ComboBox11.SelectedItems) || Motivo in ComboBox11.SelectedItems,
    IsBlank(ComboBox4_5.SelectedItems.Value) || IsEmpty(ComboBox4_5.SelectedItems) || CargoTrabajador in ComboBox4_5.SelectedItems.Value,
    IsBlank(ComboBox4_4.SelectedItems.Value) || IsEmpty(ComboBox4_4.SelectedItems) || AreaTrabajador in ComboBox4_4.SelectedItems.Value,
    IsBlank(ComboBox10.SelectedItems) || IsEmpty(ComboBox10.SelectedItems)|| (Filter of the problem stated here),
    IsBlank(ComboBox2.SelectedItems.Value) || IsEmpty(ComboBox2.SelectedItems)

  • Verified answer
    carlosguzmanbpa Profile Picture
    137 on at

    Done it this way:

     

    Filter( LongDatSource, CountRows( Filter( ComboBox10.SelectedItems, Value in Split(ZonaCorporal, ",") ) ) > 0 )

  • WarrenBelz Profile Picture
    156,293 Most Valuable Professional on at

    @carlosguzmanbpa ,

    Before I go any further here, are there any other many to many filters you need to do?

  • carlosguzmanbpa Profile Picture
    137 on at

    @WarrenBelz no, just that one

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 136 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 109 Super User 2026 Season 2

Last 30 days Overall leaderboard