How to format input for node-red-node-ui-list

I am trying to use node red to play a set of chimes to act as my doorbell. I want it to have a library of saved songs users have composed, and it seemed like the "node-red-node-ui-list" would work great for this function. Thing is, I have been trying for hours and I can't get it to display anything. I successfully used a "write file" to create a file with a list of words, and then tried to use a "read file" to pass that list to the ui list node and nothing shows up. If I change the size from auto to something else, I can see that it's taking up space on the page, but that's it. I have tried using a text input to directly pass it something to display, I have tried formatting what I pass it as my best understanding of an array, IE. ["item1","Item2"] I have tried as many different settings as I can think of on the read file and text input nodes, but I'm basically stabbing in the dark.

I am very new to node red, and I'm pretty sure I'm missing something on the "core concept" level. Any assistance, either directly, or just finding what I need to read up on would be greatly appreciated.

Hi @Callipygous, welcome to the forum. You are looking good :slightly_smiling_face:

According to the help for node-red-node-ui-list, you should pass an array of objects containing at least title plus some optional fields. This works for me:

msg.payload = [
    {title: "Apples", description: "Malus domestica"},
    {title: "Bananas", description: "Musa acuminata"},
    {title: "Plums", description: "Prunus domestica"}
return msg;

Untitled 3

Thanks so much for the reply!

That makes sense, I still haven't gotten it to work because now I'm trying to figure out how to either get my form to save entries into an array or get the read file to send it as an array.

I think I understand what I need to send it now though, I just haven't tried doing so directly.

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