Display calculated Attribute

0
Hello everyone, I want to display the data from a calculated attribute but I don’t whats the problem. My case is like following: I do a REST Call to get the data. The object which is created during this microflow looks like this:  I added a calculated attribute in the domain model (last attribute above), which gets data from the following microflow: On my Homepage, I use a “List view” widget to display the current value of my attributes. The list view widget gets data from the microflow which is doing the REST Call.  But the new calculated attribute is not shown. Also when I add a “time series” widget, I can display data from all the variables except the calculated one.  Does anybody know what I am doing wrong or where the mistake is?   best regards
asked
8 answers
0

Hi Andreas,

What is the reason you chose a calculated attribute? 

Easiest way to solve this is by turning the attribute into a normal attribute, and add the flow which returns the string behind your REST call. 

Advantage of this is that you actually have control over the amount of times the attribute is calculated. Since you don't have that control for a calculated attribute I would never suggest to use a calculated attribute.

Hope this helps!

answered
0

Hi Ward,

 

I choose the calculated attribute because I want to translate the value of my variable “programmCurrent” from int to string and depending from the value, the string variable should be different. For example, if the int = 128 then the new variable should be “on” and if the int = 256 then the new variable should be off.

I think I need the calculated attribute for this, or am I wrong with this?

 

best regards

 

answered
0

And do you still know, why the calculated attribute is not shown?

answered
0

Because you are using non persistent objects and those are only client side available. So unless you are in the same session as the user that is using the webservice you will never be able to see those. Make it a non persistent object and do the test again.

Regards,

Ronald

 

answered
0

Hello Ronald,

I changed the obekt to persitable but id doesn’t matter. I can’t choose the calculated attribute at all..

In my list view widget or time series widget I can just see the normal attributes..

I am not able to choose the calculated attribute to display data.

answered
0

You can calculate the variable after rest call:

 

If you choose to commit the objects returned by the REST call, you can also go for event handlers on the entity itself that will modify your chosen fields on a certain event, e.g. before commit.

 

Regards,

Paulina

 

answered
0

Hi Pauline,

Thank for your help!

I did like ín your exmaple but i get in an endless loop..

Maybe thats because my Rest Call response is a list from my object?

 

best regards

answered
0

Mhm I am not sure but it still doesn’t works.

But the calculated variable is working after all… 
So maybe I am just using them.. . :)

answered