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 / Getting this error: "C...
Power Apps
Answered

Getting this error: "Cannot use a non-record value in this context:" when using "ClearCollect( AddColumns( GroupBy("

(0) ShareShare
ReportReport
Posted on by 98

"Cannot use a non-record value in this context:"

 

ClearCollect(NewCollectionName,AddColumns(GroupBy(OtherCollection,"ID","ID1","ID2","GroupName"),"NewColumn",LookUp(List,ID=ID1,ReturnValue)));

Patch(List,ShowColumns(NewCollectionName,"NewColumn","ID"))

 

I'm getting the error when I add "NewColumn".  And it makes no sense at all.

 

The collection is all that there is.  And the value of "NewColumn" is an integer.

 

This is one of many columns which are calculated, and cannot be used with the Patch() function. 

 

Any ideas?

Categories:
  • Verified answer
    TxTechnician Profile Picture
    98 on at

    I solved this by creating a new collection using the showcolumns():

    ClearCollect(NewCollectionName,AddColumns(GroupBy(OtherCollection,"ID","ID1","ID2","GroupName"),"NewColumn",LookUp(List,ID=ID1,ReturnValue)));
    
    ClearCollect(NEWNEWCollection,ShowColumns(NewCollectionName,"NewColumn","ID"))
    
    Patch(List,NEWNEWCollection)

     

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

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard