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 / Trying to use Split an...
Power Apps
Unanswered

Trying to use Split and the In function

(1) ShareShare
ReportReport
Posted on by 380
I'm trying to split a text field that has multiple values per row delimited by "; "
 
Intially I am creating a collection of distinct values but then I would like to Split those values so I only have 1 value per row and I can then check to see if a value from a different List is In this list
 
My code so far is: ClearCollect(colDistinctReads,Distinct(colMRs,auth));
 
so colDistinctReads is then the datasource for a HTMLText screen where I have the following code:
SortByColumns(Filter(colDistinctReads, Not(Value in colAuthsNew.auth) ),"Value")) - this is testing to see if the auth value in colDistinctReads is IN colAuthsNew.auth but I want it the other way around so that after the split it has seperated the auths into 1 value per row
 
any help greatly appreciated thank you :)
Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    152,855 Most Valuable Professional on at
    Assuming you want Distinct value of all Auth items after splitting - try this
    ClearCollect(
       colDistinctReads,
       Distinct(
          Ungroup(
             AddColumns(
                colMRs,
                AuthVal,
                Split(
                   Auth,
                   ";"
                )
             ),
             AuthVal
          ),
          Value
       )
    )
    Please click 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 giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • bobgodin Profile Picture
    380 on at
    Warren - thanks a lot for the solution to the Split issue I was having, however I am now finding it difficult to achieve the following:
     
    I want to run a report that checks the auth values in colDistinctReads and list those that are Not IN the colAuthsNew collection
     
    I have the following code:
    SortByColumns(Filter(colDistinctReads, Not(Value in colAuthsNew.auth) ),"Value")) - this is testing to see if the auth value in colDistinctReads is IN colAuthsNew.auth but it doesn't seem to be working
     
    I must be missing something here...
    thanks
  • WarrenBelz Profile Picture
    152,855 Most Valuable Professional on at
    Hi bobgodin 
    Apart from the extra bracket on the end, that filter will show all records not in the second collection - is this what you are trying to do ?
    SortByColumns(
       Filter(
          colDistinctReads, 
          Not(Value in colAuthsNew.auth) 
       ),
       "Value"
    ) 
     
  • Suggested answer
    bobgodin Profile Picture
    380 on at
    I have solved the problem - I had to split the auth on "; " not on ";"  the leading space was causing the issue!
    thanks again Warren
  • Verified answer
    WarrenBelz Profile Picture
    152,855 Most Valuable Professional on at
    OK - that makes sense - you would have retrieved values with a leading space.

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 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard