Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Unanswered

Polymorphic lookup in gallery

(1) ShareShare
ReportReport
Posted on by 27
 
Hi!

Posted this in the general category, but no luck. Feel free to remove if you dont think the question belongs here 🙂

 

Feels like i've tried it all, and now i need your help 

Building a canvas-app to display the 5 cases that are closest to the 'failure time' in regards of the SLA, and i want to display these in a gallery.

The issue is that i need the account-name related to the case to show, but i cant get that to work. 

 

Most solutions i've tried is related to using the table 'SLA KPI Inscance' to extract this data, via the polymorphic field 'Regarding'. 

Started out with the simple 'ThisItem.Regarding.***' gives a lot of options (case title, etc) but not the name of the account, and the  latest i tried without success was:

 

 

LookUp(Cases,Case = GUID(ThisItem.'Regarding ID'),
AsType(Customer, Accounts).'Account Name')

 

 

Doesnt throw and error but the account name is not displayed.

I assume that the issue is that the Account is a look-up filed in the Case. 

 

Any ideas on how to proceed?

 

Kind regards,

Anders

  • Anders_S Profile Picture
    27 on at
    Re: Polymorphic lookup in gallery

    Hi!

    Thank you for helping out with this matter. 

    I've added Accounts as source, but the AccountID is not recognized. I do get a lot of suggestions of columns from the Account-table, so the source is there, but the AccountID is not one of them.

     

    Could this be related to the fact that the Customer could be either a account or a contact?

     

  • gcmfaizan Profile Picture
    1,022 on at
    Re: Polymorphic lookup in gallery

    Hi @Anders5 ,

     

    It sounds like you're trying to display a list of cases in a gallery in a Power Apps canvas app, and you want to show the account name associated with each case. Since the account is a lookup field in the case, you need to use the Lookup function to retrieve the related account information. Here's how you can approach this:

    1. Make sure your gallery is bound to a collection or data source that contains the list of cases.

    2. Within your gallery, you can use the Lookup function to retrieve the related account information.

     

    Label.Text: Lookup(Accounts, AccountID = ThisItem.Customer.'Account ID', 'Account Name')

     

     

    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 89 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 72 Super User 2025 Season 1

#3
mmbr1606 Profile Picture

mmbr1606 71 Super User 2025 Season 1

Overall leaderboard