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 / LookUp for a Column in...
Power Apps
Answered

LookUp for a Column in a Filter

(0) ShareShare
ReportReport
Posted on by 60

Hello,

 

I have two tables in dataverse. ATIV_REQ_Requisition_History and ATIV_REQ_GrabePlace. The first one has an ID that reference the second one, for example in a row of the first I have a column GrabePlaceID (1) and wna't to LookUp for the Name associated with that ID in the Second table.

 

So far I have the data from the first table:

 

 

Set(
 Trash;
 RenameColumns(
 ShowColumns(
 Filter(
 ATIV_REQ_Requisition_History;
 DateTimeRequest >= dtStartDateExport.SelectedDate And DateTimeRequest <= dtEndDateExport.SelectedDate
 );
 "cr6ec_cc";
 "cr6ec_datetimerequest";
 "cr6ec_mailrequester";
 "cr6ec_observations";
 "cr6ec_justification";
 "cr6ec_usernamerequester";
 "cr6ec_grabeplaceid";
 "cr6ec_reqtypeid";
 "cr6ec_statusid"
 );
 "cr6ec_cc";
 "CC";
 "cr6ec_datetimerequest";
 "DateTime Request";
 "cr6ec_mailrequester";
 "Mail Requester";
 "cr6ec_observations";
 "Observations";
 "cr6ec_justification";
 "Justification";
 "cr6ec_usernamerequester";
 "UserName Requester";
 "cr6ec_grabeplaceid";
 "GrabePlaceID";
 "cr6ec_reqtypeid";
 "ReqTypeID";
 "cr6ec_statusid";
 "StatusID"
 )
);;

 

and the result:

Reze_1-1664270001955.png

 

So, I need to replace the column GrabePlaceID by the real name that I would get from the second table: LookUp(ATIV_REQ_GrabePlace;ID = ????;GrabPlaceName).

 

I don't know how to join the two queries.

 

Thanks

 

Categories:
  • BCBuizer Profile Picture
    22,854 Super User 2026 Season 2 on at

    Hi @Reze,

     

    If I understood correctly you want to insert a LookUp for the GrabePlaceID column like below:

     

    Set(
     Trash;
     RenameColumns(
     ShowColumns(
     Filter(
     ATIV_REQ_Requisition_History;
     DateTimeRequest >= dtStartDateExport.SelectedDate And DateTimeRequest <= dtEndDateExport.SelectedDate
     );
     "cr6ec_cc";
     "cr6ec_datetimerequest";
     "cr6ec_mailrequester";
     "cr6ec_observations";
     "cr6ec_justification";
     "cr6ec_usernamerequester";
     "cr6ec_grabeplaceid";
     "cr6ec_reqtypeid";
     "cr6ec_statusid"
     );
     "cr6ec_cc";
     "CC";
     "cr6ec_datetimerequest";
     "DateTime Request";
     "cr6ec_mailrequester";
     "Mail Requester";
     "cr6ec_observations";
     "Observations";
     "cr6ec_justification";
     "Justification";
     "cr6ec_usernamerequester";
     "UserName Requester";
     "cr6ec_grabeplaceid";
     "GrabePlaceID";
     LookUp(ATIV_REQ_GrabePlace;ID = "cr6ec_reqtypeid";GrabPlaceName);
     "ReqTypeID";
     "cr6ec_statusid";
     "StatusID"
     )
    );;

     

  • Reze Profile Picture
    60 on at

    Hi @BCBuizer,

     

    Thanks for the help.

     

    It gives me an error message like 'The argument xxxxx is invalid. It was expected a literal text'. And it's in the RenameColumns section that give me another error 'RenameColumns have some invalid arguments'.

     

    Thank you

  • Verified answer
    Reze Profile Picture
    60 on at

    Hi,

     

    I figured out. Thank you for your help @BCBuizer.

     

    Set(
     query;
     RenameColumns(
     ShowColumns(
     AddColumns(
     Filter(
     ATIV_REQ_Requisition_History;
     DateTimeRequest >= dtStartDateExport.SelectedDate And DateTimeRequest <= dtEndDateExport.SelectedDate
     ) As a;"GrabePlaceName";LookUp(ATIV_REQ_GrabePlace;cr6ec_id = Text(a.cr6ec_grabeplaceid)).Name;"ReqTypeName";LookUp(ATIV_REQ_ReqType;cr6ec_id = Text(a.cr6ec_reqtypeid)).Name;"StatusName";LookUp(ATIV_REQ_ReqStatus;cr6ec_id = Text(a.cr6ec_statusid)).Name);
     "cr6ec_cc";
     "cr6ec_datetimerequest";
     "cr6ec_mailrequester";
     "cr6ec_observations";
     "cr6ec_justification";
     "cr6ec_usernamerequester";
     "GrabePlaceName";
     "ReqTypeName";
     "StatusName"
     );
     "cr6ec_cc";
     "CC";
     "cr6ec_datetimerequest";
     "DateTime Request";
     "cr6ec_mailrequester";
     "Mail Requester";
     "cr6ec_observations";
     "Observations";
     "cr6ec_justification";
     "Justification";
     "cr6ec_usernamerequester";
     "UserName Requester"
     )
    )

     

     

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard