cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

OData and MDK: I can't access the value of a property of an entity related to $expand

emorales
Explorer
0 Kudos
436

Hello community, thank you very much for the help. I have an exposed odata v4 service which gives me two entities that are related. If I build the query correctly using expand I can get results like this:

emorales_0-1724174180756.png

The problem is that in my mobile application it is showing me the description of the "Audit" entity and not the description of the "TipoAuditoria" entity.

I set up the relationship like this. My detail view "Auditoria_Detail.page" is like this:

emorales_1-1724174255064.png

And in my edit view, we can see that the values ​​are taken as follows:

emorales_2-1724174320845.png

{Auditoria/DESCRIPCION}

{TipoAuditoria/DESCRIPCION}

At first glance everything seems to be fine, but when I enter my application I find the following:

emorales_3-1724174468584.png

It gives me the description for Audit. What am I doing wrong? In "Tipo de auditoría" it should say: "Auditoría Operativa"

 

Accepted Solutions (1)

Accepted Solutions (1)

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

I see where you have set the design time target for your detail page to include the $expand=TIPOAUDITORA but keep in mind that this is used only in the editor to know what properties are assumed to be available when using the Object Browser.  At runtime for these bindings to work the default binding object passed into the page is assumed to have been expanded and available.  

Assuming you are coming from a list page you need to make sure the list target has the same $expand in the target so the expanded properties are available on the detail page.

emorales
Explorer
0 Kudos
You're right ! Thanks bill 🙂

Answers (0)