Other variable than msg.payload into ui text?

Hello,

I'd like to put global values into the Value format of the ui text. Is it possible ? Or just msg.payload are accepted ? Otherwise I don't know how could I print all my variables separately in the dashboard.

Thank you :slight_smile:

No you can not directly get global values in the ui-text node.

However you can add a change node just before the ui-text node to grab the value from a global value and put it into msg.payload.

1 Like

I tried that, for each parameter, I moved the value into a msg.payload. I created a subflow for doing that, because I have to reuse it for several machines. There is one output in the subflow for each variable. After, I linked the right output to the right element of the dashboard. It was the solution I've found in order to put a msg.payload into the ui text field. But it doesn't work, the system understands that msg.payload = all the values, so all the ui text print all the values rapidly...

I've found an alternative, but it's not optimized. I did the same work but I put the ui text directly next to the change nodes "moving" values into the same subflow. It works, but I'll have to link all these nodes for every machines I have... I'd like to generalize it.

It is better to pass the data in messages rather than global context. You should try not to use global or flow context.
All you have to do is to change your flows so that, instead of writing to global data you send it directly to the text node

1 Like

I've found my mistake... I've changed the value earlier into the ui text field, it was not payload... In fact my 1st solution works now. I'm really sorry for the inconvenience. However I think this topic could interest some people :slight_smile:

And thanks for the advice Colin !

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.