Show entitiy attribute label inside expression

Show entitiy attribute label inside expression

  

Hi guys, how can I show this label atribute inside an expression widget ?



As you can see in the image above, I can't access the "label" property from my TemperaturaId.

How can I accomplish that ?


Best regards,

Leandro

leandro silva wrote:

Hi guys, how can I show this label atribute inside an expression widget ?



As you can see in the image above, I can't access the "label" property from my TemperaturaId.

How can I accomplish that ?


Best regards,

Leandro

Hi Leandro.

If I understood your doubt, you want to get the label from the entity Temperatura, correct?

You should simply use an aggregate instead with a join between Oportunidade and Temperatura?

If for some reason you really want to use entity actions you can do something less elegant as the following:

GetTemperatura(GetOportunidade(OportunidadeId).Oportunidade.TemperaturaId).Temperatura.Label 

just be careful if one of the keys are null.


Cheers,

GM

Hi Gonçalo,

I replied to a "very" similar post here: https://www.outsystems.com/forums/discussion/26717/show-entitiy-attribute-label-inside-expression

But I understood the question differently.

So Leandro, what is it that you're trying to accomplish?

Cheers,

José

Hi José.

Now I see. I think that what Leandro wants is actually access to the entity metadata to get an attribute label.

This being said, he can query some system entities, doing something like this:

Cheers,

GM

You can also check by the entity diagram that follows, that you can access all the Entity and its attributes definitions:

Hope it helps.

Hi Gonçalo,

I think that was the answer they were looking. I deleted my previous answer in the other post, since it was not right, and linked the other post to your answer.

Cheers,

José

Hi José.

Let see if Leandro gives some feedback.

Thank you for pointing the correct issue, because I misunderstood it at the first time :)

Cheers,

GM

Gonçalo Martins wrote:

Hi José.

Now I see. I think that what Leandro wants is actually access to the entity metadata to get an attribute label.

This being said, he can query some system entities, doing something like this:

Cheers,

GM

Hi, Gonçalo.

First of all, thanks for your answer and sorry about the double post. It was a communication problem here.


So, your answer has the correct result, but I was looking for something less complicated.

What I want to do is create a "best practices" at my future team to help future in changes. In other words, if all my Forms have a label directly linked to an attribute's label and we need to change its text, we need to change it only once.


I tried your solution using the aggregate component, but this is the only way I colud do it.

As you can see, I had to search for literal expressions "Oportunidade" and "TemperatuarId". So, if I change it on my database Entities, I will need to update it manually


Is that a way to do it ?


Thanks !


Hi Leandro.

I think I understand your concern, but that kind of work I believe you can only do it by accessing the meta model I show to you. 

For your use case, I would rather prefer to have an extra step in your development cycle where someone could take a look and peer review all those team best practices or, even have someone auditing the code at the end of each sprint. 

If you decide to go through a solution using those entities, it will be hard to manage and maintain, since someone will always need to add every new object created to the logic.

Hope it helps.

Cheers,

GM

Hi Gonçalo.


Thank you again for your kindness.

It's sad to know that this kind of approach isn't supported by Outsystems. We are new using this kind of development tool and having some troubles about a lot of things that help us in future maintenance. If this works the way I need it, it would be very good.


Best regards,

Leandro


Hi Leandro.

Can you please define what are your requirements? And maybe give an example of a tool / platform that does that?