Showing label of and Id in expression

I want to display the luDetails label instead of typing "Killed" in the expression.


Hi Divan,

Could you share more details about what you're trying to achieve? If you can provide us with screenshots or an example OML, it will be easier for everyone to assist.

Doesnt seem my screenshot uploaded.

Solution

This is a good idea, since you avoid hardcoding these strings in your application, and if you use the static entity values for them, you just need to change them in one place.

There's a couple of ways to do this:

 - Use a text Identifier for your Static Entities. This is the easiest one since if the Id of your luDetail.Killed value is "Killed", you can directly use your static entity value on your screen and it will display the Id, which you can name "Killed". This is only feasible if you're starting out your application and you havent deployed it anywhere, otherwise you'd have to worry about changing your data model with existing data;

 - Get the entire Static Entity value, and then access the label inside of it. If you look at your luDetail Static Entity, you'll notice you can access a Get function. You can use this in expressions to get a specific value (in this case, Killed) and then accessing any fields within it (in this case the label). This is not as good as the first option, since you're doing an additional fetch from the database.

 - Assuming you're already fetching data for your ListRecords, you could just join this Static Entity to your query, and then just use the label from there:

Solution

Hi Divan,

You are not really telling us what the problem is.

Share more context for example with a screenshot.

Regards.

Daniel