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 / How to filter a column...
Power Apps
Answered

How to filter a column having semi colon separated values in a collection by a column in another collection?

(0) ShareShare
ReportReport
Posted on by

Hi Folks,

 

I have a dataverse table with a text column that stores project codes separated by semi colon (there can be only one project code as well in which case ";" might not be present). The table has other needed columns as well. I create a collection  during app on start which contains project codes where current user has access. It just has a single column and one entry of project code per row.

 

Now, I would like to filter the data verse table based on the project codes in the local collection. How is this possible?

 

Example:

 

Data verse Table:

 

Column1ProjectCode
Vendor1P12,P23,P14,P11
Vendor2P33,P55

 

Local Collection:

 

ProjectCode

-----------

P12

P14

 

Expected output:

 

Column1ProjectCode
Vendor1P12,P23,P14,P11

 

Edit: I tried below code with ForAll it seems to be working:

 

 

ForAll(colAdminProjects As adminProject,
Collect(colViewEmployeeVendors, Filter(Vendors,Active, adminProject.projectCode in ProjectCode))
)

 

 

Please share your suggestions, if there's any better approach

 

Thanks.

Categories:
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @rbn_nue ,

     

    I created 2 collections in my App:

    vjefferni_0-1694678490968.png

     

    So, col1 represents the Dataverse table and col2 represents the collection on your end. 

     

    In a Gallery's Items, I applied below formula to get the result:

    vjefferni_1-1694678598906.png

    Filter(
     AddColumns(
     AddColumns(
     col1 As c1,
     "PCs",
     Split(
     c1.ProjectCode,
     ","
     )
     ) As CC,
     "TF",
     !IsBlank(
     LookUp(
     ForAll(
     col2 As c2,
     c2.ProjectCode in CC.PCs
     ),
     Value = true
     )
     )
     ),
     TF
    )

     

    The logic is, adding two columns into the Dataverse table as a temporary table, the first column that was added includes tables of all ProjectCodes split by the separator ",", the second column includes the results that checking if any ProjectCode of the user is in previously added projectcodes table. In the end, filter the temporary table and get the records that the checking result is true.

     

    Best regards,

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

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard