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 / Strange behavior when ...
Power Apps
Answered

Strange behavior when using AddColumns

(0) ShareShare
ReportReport
Posted on by 61

Hello everyone,

 

I got really strange behavior here, maybe someone can explain what is happening?

Basically following formula works only if there is "Lower"  but it does not matter in which part? If I remove "Lower" from both emails, formula stop working. I'm using similar formula in other places and it works fine without "Lower", this happens only when used with "AddColumns".

WORKS:
 

 

AddColumns(
 SPlist1,
 "SortField1",
 CountRows(Filter(Sort(SPlist2,ID,Descending), 
Lower(List1Person.Email) = List2person.Email))

 


WORKS:

 

AddColumns(
 SPlist1,
 "SortField1",
 CountRows(Filter(Sort(SPlist2,ID,Descending), 
List1Person.Email = Lower(List2person.Email) ))

 


DOES NOT WORK:

 

AddColumns(
 SPlist1,
 "SortField1",
 CountRows(Filter(Sort(SPlist2,ID,Descending), 
List1Person.Email = List2person.Email))

 

 

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

    Hi @Kubo ,

    Try this - StartsWith() is not case sensitive and is a good Delegable workaround

    AddColumns(
     SPlist1,
     "SortField1",
     CountRows(
     Filter(
     Sort(
     SPlist2,
     ID,
     Descending
     ), 
     StartsWith(
     List1Person.Email,
     List2person.Email
     )
     )
     )
    )

     

    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.

    Visit my blog Practical Power Apps

     

  • Kubo Profile Picture
    61 on at

    Hi @WarrenBelz ,

    Thank you for the reply.

     

    That would be great workaround but for some reason I'm getting delegation warning on StartsWith this way:

    "Part of this formula cannot be evaluated remotely. The 'StartsWith' function cannot be delegated if a field name appears in the second argument. Delegation warning. The "Filter" part of this formula might not work correctly on large data sets."

    I have tried different way of writing the formula but cannot get rid of the warning. 

  • WarrenBelz Profile Picture
    154,889 Most Valuable Professional on at

    Hi @Kubo ,

    Neither AllColumns() nor CountRows() are Delegable anyway (they are 'hidden" Delegation limitations), so I am assuming that is the basis of the warning (although I have not seen that one before). StartsWith() is Delegable, but the returned result needs to be under your Delegation limit or CountRows will return a partial result.

     

    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.

    Visit my blog Practical Power Apps

  • Kubo Profile Picture
    61 on at

    Thanks again @WarrenBelz , I'm trying to pre-filter and sort data before delegation for CountRows hits. I will use workaround for now, I have saved email addresses as a plain text in SP list and I will use this to match the columns.

  • Verified answer
    WarrenBelz Profile Picture
    154,889 Most Valuable Professional on at

    Hi @Kubo ,

    If Delegation is your issue, you can try this

    With(
     {
     wList:
     Filter(
     Sort(
     SPlist2,
     ID,
     Descending
     ), 
     StartsWith(
     List1Person.Email,
     List2person.Email
     )
     )
     },
     AddColumns(
     wList,
     "SortField1",
     CountRows(wList)
     )
    )

     

    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.

    Visit my blog Practical Power Apps

  • WarrenBelz Profile Picture
    154,889 Most Valuable Professional on at

    Hi @Kubo ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    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.

    Visit my blog Practical Power Apps

  • Kubo Profile Picture
    61 on at

    Thank you very much @WarrenBelz , that helped a lot! 

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
11manish Profile Picture

11manish 547

#2
WarrenBelz Profile Picture

WarrenBelz 444 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard