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 / Internal error in the ...
Power Apps
Answered

Internal error in the AddColumns function: ,,,ReferenceError: result26 is not defined."

(0) ShareShare
ReportReport
Posted on by 3

Hi! I am adding a column to a collection but it seems to be not working. My collection shows 12 rows, but when I view it, there is no data reflecting.

Here is the code:

UpdateContext({Team: LookUp(Teams, ID=gloTeamID)});
UpdateContext({Period: LookUp(SurveyPeriods, ID=gloPeriodID)});UpdateContext({rowscnt:CountRows(Filter(TeamResponse, TeamID=gloTeamID))});ClearCollect(TeamRes, Filter(TeamResponse, TeamID=gloTeamID));

ClearCollect(TeamResponse1,
AddColumns(TeamRes,
"Level", LookUp(Levels,ID=TeamRes[@LevelID], Level),
"Team", LookUp(Teams,ID=TeamRes[@TeamID], TeamName),
"Period", LookUp(SurveyPeriods,ID=TeamRes[@PeriodID], Name),
"Segment", LookUp(Segments, ID = LookUp(Teams,ID=TeamRes[@TeamID], SegmentID), SegmentName)
)
);

//Group by and sum column code
ClearCollect(
periodsColl,
DropColumns(
AddColumns(
GroupBy(TeamResponse1, "Period", "Team","TeamID","grouped"),
"Score",Round(Average(grouped,Score),1)
),
"grouped"
)
);


Attached is the columns tab

qqqq.PNG
Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,750 Most Valuable Professional on at

    Hi @ksestrada ,

    A bit difficult without something to test this on, however I notice you have both a Variable and a field name called Period (so naming protocols are important here. I have also tidied the code up a bit so there is a base to work on, but try this. Also do you have any blank values in Score as this will definitely error.

    UpdateContext(
     {
     varTeam: 
     LookUp(
     Teams, 
     ID = gloTeamID
     ),
     varPeriod: 
     LookUp(
     SurveyPeriods, 
     ID = gloPeriodID
     ),
     varRowscnt:
     CountRows(
     Filter(
     TeamResponse, 
     TeamID = gloTeamID
     )
     )
     }
    );
    With(
     {
     _TeamRes, 
     Filter(
     TeamResponse, 
     TeamID = gloTeamID
     )
     },
     With(
     {
     _Response:
     AddColumns(
     _TeamRes,
     "Level", 
     LookUp(
     Levels,
     ID = LevelID
     ).Level,
     "Team", 
     LookUp(
     Teams,
     ID = TeamID
     ).TeamName,
     "Period", 
     LookUp(
     SurveyPeriods,
     ID = PeriodID
     ).Name,
     "Segment", 
     LookUp(
     Segments, 
     ID = 
     LookUp(
     Teams,
     ID = TeamID
     ).SegmentID
     ).SegmentName
     )
     },
     ClearCollect(
     periodsColl,
     DropColumns(
     AddColumns(
     GroupBy(
     _Response, 
     "Period", 
     "Team",
     "TeamID",
     "grouped"
     ),
     "Score",
     Round(
     Average(
     grouped,
     Score
     ),
     1
     )
     ),
     "grouped"
     )
     )
     )
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • ksestrada Profile Picture
    3 on at

    This worked! Thank you very much!

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 223

Last 30 days Overall leaderboard