web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / LookUp for a Column in...
Power Apps
Unanswered

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:
I have the same question (0)
  • BCBuizer Profile Picture
    22,505 Super User 2025 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard