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 / Get value of lookup fi...
Power Apps
Answered

Get value of lookup field in collection

(1) ShareShare
ReportReport
Posted on by 301

I am wanting to create a collection based on a dataverse table.

I have created views, but these don't seem to be very easy to use in this circumstance.  I was able to return the entire set of columns but the lookup fields didn't have any values.

I have been trying ShowColumns to get the few column values I need from the table 'QPContainers'.  I strike an issue with a column called 'Location' as it is a lookup column to a table called 'QP Location'.

This worked to get a list of containersIDs

Collect(
 cltPickUpView,
 ShowColumns(
 Filter(QPContainers, PickUpDT = Blank()),
 "qp_containerid"
 )
)

 

I thought addColumns might be required here but I can't figure out how to use it.

Any help would be appreciated.

 

Thanks

Rosie

 

 

Categories:
I have the same question (0)
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Rosie ,

     

    I made a sample for you.

    vxiaochenmsft_0-1683171780131.png

    ShowColumns(AddColumns(TestL16,"related table's primary name column value",Test_LookUp.Name),"name","related table's primary name column value")

     

    Best Regards,

    Wearsky

  • Rosie Profile Picture
    301 on at

    Hello,

    Thanks for your help, but this hasn't worked for me.

    Also I still need to filter the data by the PickupDate and I am a bit unsure where to fit that into ShowColumns and AddColumns.

     

    When I follow what you have I still only get the Container ID column, no Location column.

     

    ClearCollect(cltPickUpView,
     ShowColumns(
     AddColumns(
     QPContainers,"LocationN",qp_Location.'Location Name'
     ),
     "qp_containerid"
     )
    );

     

     

    Rosie_0-1683502828941.png

     

  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Rosie ,

     

    Try this:

    ClearCollect(cltPickUpView,
     ShowColumns(
     AddColumns(
     Filter(QPContainers, PickUpDT = Blank()),"LocationN",qp_Location.'Location Name'
     ),
     "qp_containerid",
     "LocationN"
     )
    );

     

    Best Regards,

    Wearsky

  • Rosie Profile Picture
    301 on at

    Thanks so much.

    I did make some progress with getting the LocationN in there - didn't quite follow your example - my apologies.

    Thanks so much for adding the Filter section.  I will give that a go now.

    Many thanks

    Rosie

  • Rosie Profile Picture
    301 on at

    This is what I ended up with.  Two collections to filter the first collection without delegation warnings.

    ClearCollect(
     cltPickUpByPickUpDT,
     ShowColumns(
     AddColumns(
     Filter(
     QPContainers,
     PickUpDT = Blank() 
     ),
     "LocationN",qp_Location.'Location Name'//lookup field to another table
     ),
     "qp_containerid",
     "qp_bookingnumber",
     "LocationN",
     )
    );//gets all container without a pick up date
    
    ClearCollect(
     cltPickUpView,
     Filter(
     cltPickUpByPickUpDT,
     qp_containerstatus in "Located" && qp_type in "Fit to Order"
     )
    );//Filters the collection cltPickUpByPickUpDT to those that are Located and Fit to order types. 
  • Thami Profile Picture
    on at

    Struggled with my criteria and proposal evaluation Dataverse lookup, adding AddColumns worked!!!!  Thank you very much.

    ClearCollect(
        colEvaluationDetails,
        ShowColumns(
            AddColumns(
            Filter(
                'Evaluation Details',
                'Proposal Evaluation ID'.'Proposal Evaluation Description' = varSelectedProposalEvaluationID
            ), "Criteria",'Evaluation Criteria ID'.'Criteria Name', "Proposal Evaluation", 'Proposal Evaluation ID'.'Proposal Evaluation Description'),
            "ndagrf_comments",
            "ndagrf_criteriamaxscore",
            "ndagrf_evaluationdetailsid",
            "ndagrf_evaluationscore",
            "ndagrf_name",
            "Criteria",
            "Proposal Evaluation"
         )
    );

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 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard