Generating a list using ui_list-widget from MSSQL PLus

I´ve been struggling for a while now, to format my msg.payload in a way, that it is displayed in ui_list.

grafik

I found this entry here in the forum:

But I didn´t really get how to solve my problem.
Any feedback welcome.

A snippet from the help for ui_list:
Untitled 1

So does it work if you change your SQL query to
select Toolnr as title, Model from All_Tools where Loction = 'Werkzeugbau' ?

I could solve it after you made me aware, that the widget needs a message.payload.title.
So I wrote a function that iterates through the array and generates titles for every entry.

var schritt;
msg.test = msg.payload.length;
for(schritt = 0; schritt < msg.payload.length;schritt++)
{
    msg.payload[schritt].title = msg.payload[schritt].Toolnr + '-' + msg.payload[schritt].Model;

}

 return msg;

grafik

You could just as easily have done the text concatenation and generated this title field SQL query.

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