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 but filtering o...
Power Apps
Answered

Lookup but filtering on active records only

(0) ShareShare
ReportReport
Posted on by 24

Hi All,

 

I looking for some help as I can't get a forumla together without an error.

 

I have three tables

Helpdesk - It holds details of fault tickets.

Engineer Assignments - A table that holds which engineers have been assigned to a helpdesk ticket. 

Engineers - Holds the name a details of the engineer

 

Each table is has a CDS lookup, Helpdesk to Engineer Assigment and Engineer Assigment to Engineers

I have a canvass app that I've created that has a gallery that shows Open Helpdesk tickets.

I can retrieve the Engineers Name from my table but only the first record, even if its inactive.

 

What I want to be able to do is change the formula below to either show Status=Active records from Engineer Assignments or show the last record from Engineer Assignment which would also be the active record, but I still need to retrieve the engineer name. I just don't seem to be able to cover both objectives.

 

LookUp('Engineer Assignments',Ticket.Helpdesk= ThisItem.Helpdesk, Engineer.Name)

 

Thanks

 

 

 

Categories:
I have the same question (0)
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @dgarrick It's possible to do what u want. But could you please share a little more about the fields you have in each of the tables (particularly the lookups). Could u also clarify your 2 objectives a more.

  • dgarrick Profile Picture
    24 on at

    Hi @CNT thanks for responding.

     

    Objective is to have a gallery show the following fields

     

    Ticket No, Client, Site from the Helpdesk Table then the Engineers Name. I've attached a screenshot of some data tables showing the GUID fields. I've got the lookup to retrieve the name using the formula below, but I want to firther restrict it to only look at the Engineer Assignments table, Status Active, before it does the lookup of the engineers name.

     

    LookUp('Engineer Assignments',Ticket.Helpdesk= ThisItem.Helpdesk, Engineer.Name)

     

    Tables.png
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @dgarrick Try this formula. Here I'm assuming that Status is a Text Field and that there is only one "Active" Assignment for each Ticket. If this is not true, well have to modify this slightly. Please let me know.

    LookUp('Engineer Assignments',Ticket.Helpdesk= ThisItem.Helpdesk && Status="Active").Engineer.Name

     

  • dgarrick Profile Picture
    24 on at

    Hi @CNT 

    Looking at the lookup you've provided it looks like your saying if the helpdesk ticket is active, lookup the engineers name.

    The lookup I provided looks up the engineers name using the GUID from Engineers Assignments table, but I need it to only look at active status records from the engineers asssignments table.

    The engineer assignments status does not appear in the heldesk data table.

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @dgarrick If I understand it right, you have a gallery with datasource, Helpdesk table.

    For any selected item in the gallery there could be many records in the Engineers Assignments table but you want you want to find the "Active" one. Then further find the Engineer assigned to this single "Active" Assignment.

    Is this right?

  • dgarrick Profile Picture
    24 on at

    @CNT , Thats exactly right thats what I want to acheive.

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @dgarrick Please try this formula that I had given earlier and let me know if it gives the results you want (make sure the Table, column names match your schema).

    LookUp('Engineer Assignments',Ticket.Helpdesk= ThisItem.Helpdesk && Status="Active").Engineer.Name
  • dgarrick Profile Picture
    24 on at

    That didnt work, showing a red marker under the equals before the status part in the lookup.

    dgarrick_0-1622113319210.png

     

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @dgarrick I believe the Error is because the Status is not a String. I don't know that is the data type unless you tell me.

  • dgarrick Profile Picture
    24 on at

    I looking at the inbuilt status where you can choose as active or inactive.

    Screen grab of the table structure for status is below.

     

    dgarrick_0-1622114482977.png

     

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 514

#2
WarrenBelz Profile Picture

WarrenBelz 419 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 295

Last 30 days Overall leaderboard