cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Joe5
Frequent Visitor

Lookup fields not in scope.

Hi there! I'm working on building my first power app from D365 data. I had tons of issues getting the forms to save using the actual D365 connection, so I'm using the CDS variants of the entities I need.

 

The app is built on a custom Application entity, and ever since I changed to the CDS connections I've lost scope for all my lookups in my browse view. I'm hoping for some information on how to get access to them, and any more information on how things are handled behind the scenes would be great too.

 

365LookupForm.png365 Application form. 4 Lookups: Customer, Product, Shipping Speed, and Destination AddressCustomer is a Contact, Product and Shipping Speed are Products, and Destination Address is a Custom Address entity. There are all brought in as CDS sources.

 

 

 

DetailsView.png4 Lookups are missingYou can see in the default browse screen all 4 Lookups are missing from available fields to select from Application, though they should exist as fields in every app. The Lookup function up top worked when I connected the data via 365, but not with the CDS. 

 

 

 

LookupEdit.pngLookups available as edit fieldsThe lookup fields ARE available to add on the edit screen. I'm just not sure what the difference is and why they aren't available/out of scope on the browse screen.

 

 

 

 

 

 

 

I'm trying to understand a bit about and configuration and seeing what data is stored where so I can troubleshoot why I'm running into lots of things like this! I know most of this can be worked around by scripting in the variables and stuff, but I wanted to work with the default template before I dive in that!

 

Thanks so much,

joe

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Lookup fields not in scope.

I think the error is because the two sides of the equation are not of the same type (hence the invalid argument type error). Left side of the equation is a GUID and right side of the equation is a record. If Customer is a lookup field of type Contact, try this:

LookUp(Contacts, contactid = ThisItem.Customer.contactid).'Full Name'

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

View solution in original post

5 REPLIES 5
Super User
Super User

Re: Lookup fields not in scope.

So in your view screen or gallery, you need to type the following formula if you want to see any values of lookup fields.

LookUp(Contacts, comtactid = ThisItem.Customer).'Full Name'

LookUps are not text fields and in galleries, you can only show text values. What you have would work too but after your LookUp function type a . and you will get some suggestions. It might be fullname or value.

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com
Joe5
Frequent Visitor

Re: Lookup fields not in scope.

Hey thanks for your response! I do have correct syntax for obtaining a lookup in the box as per Photo 2, but the underlying issue is that This.Customer, as well as the rest of the lookup fields, are not being recognize/accessible as part of the gallery screen for some reason. This prevents the look up function such as LookUp(Contacts, contactid = ThisItem.Customer).'Full Name' from returning a result because ThisItem.Customer is not accessible.

 

Here is a picture of what my formula/errors/hints looks like for the field in question:

https://imgur.com/a/NvlKhav

 

Thanks so much again, 

Joe

Super User
Super User

Re: Lookup fields not in scope.

I think the error is because the two sides of the equation are not of the same type (hence the invalid argument type error). Left side of the equation is a GUID and right side of the equation is a record. If Customer is a lookup field of type Contact, try this:

LookUp(Contacts, contactid = ThisItem.Customer.contactid).'Full Name'

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

View solution in original post

Joe5
Frequent Visitor

Re: Lookup fields not in scope.

Ah this was it! I've used the previous formula before to compare Id and Customer since if you add only This.Customer to a form it returns the GUID but this is probably better practice anyway!

 

Thanks so much, Kudos!

Super User
Super User

Re: Lookup fields not in scope.

Glad I could help! Good luck with the rest of your app! Feel free to reach out in case of any questions!

Thanks,
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

Helpful resources

Announcements
secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (6,745)