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 / Name Isn't Valid Using...
Power Apps
Answered

Name Isn't Valid Using ClearCollect

(0) ShareShare
ReportReport
Posted on by 35

Guys - I have seen numerous postings out there concerning this issue, but none that are specific to my issue.

More specifically, I have two collections that I am working with: totalAgentsByMetro and totAgentsByMetroCount, referenced here below. Could it be an issue w/ the length of the collection name? I tried reducing it a few characters, and even that did not work.

 

Here is my code snipet that is returning the error: Name Isn't Valid...totalAgentsByMetroCount is not valid.

ClearCollect(totAgentsByMetroCount, AddColumns(totalAgentsByMetro,AgentCount, CountRows(Filter('Agents', MetroArea = totalAgentsByMetro[@Result])));
 
In addition, I created a separate ClearCollect whereas, I was able to create the collection and create a table with rows. But the above never works...more specifically when using AddColumns although no errors appear here. 
Categories:
I have the same question (0)
  • Verified answer
    RH-25092337-0 Profile Picture
    35 on at

    All - I figured the issue out myself. Simply needed to adjust the lines w/n the AddColumns. See below before and after. Issue was w/n the comparsion values and their respective placement w/n the code.

     

    - - -  BEFORE - - - 

    ClearCollect(totAgentsByMetroCount, AddColumns(totalAgentsByMetro,AgentCount, CountRows(Filter('VPS Agents',MetroArea=totalAgentsByMetro[@Result]))));
     

    - - - AFTER - - - 

    ClearCollect(totAgentsByMetroCount, AddColumns(totalAgentsByMetro,AgentCount, CountRows(Filter('VPS Agents',totalAgentsByMetro[@Result] in MetroArea))));

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!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 85

#2
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard