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 / AddColumn with Lookup ...
Power Apps
Answered

AddColumn with Lookup for each Record in Collection

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I have a collection that I want to add a column to. For each record I need to return the Question by looking up the idQuestion from the collection to a different table. The problem is that the collection results in repeating the first result (Question) through each record.

 

For example:

Here is what I'm getting in my collection:

idQuestionQuestion
1Question 1
2Question 1
3Question 1
4Question 1

 

This is what I want:

idQuestionQuestion
1Question 1
2Question 2
3Question 3
4Question 4

 

Here is my code:

 

ClearCollect(
 colSurvey,
 AddColumns(
 '[dbo].[Surveys]',
 "Question",
 LookUp('[dbo].[SurveyQuestions]',idQuestion = idQuestion,Question)
 )
)

 

Thank you

Categories:
I have the same question (0)
  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    @justair007 
    The issue is with this section of code

    idQuestion = idQuestion

     

    You'll need to specify which table the idQuestion comes from using the disambiguation operator [@] as I have done below.

    ClearCollect(
     colSurvey,
     AddColumns(
     '[dbo].[Surveys]',
     "Question",
     LookUp('[dbo].[SurveyQuestions]',idQuestion = '[dbo].[Surveys]'[@idQuestion],Question)
     )


    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @mdevaney Perfect! Silly oversight on my part.

     

    Thank you!

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 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard