What is the best way to pass lists as parameter?

So, I understand that when building a plugin, you can check the “is list” option, but I’m having trouble using it effectively. In my database, I have records for each day of the year along with a boolean value indicating whether the day is valid or not.

My plugin is designed to calculate valid days within a specified date range, and it returns a list of valid dates based on the true/false values associated with each day.

I’m facing two issues. The first one is that I can’t use “is a list” when passing the parameter because it returns a strange object (this: {length: ƒ, get: ƒ} get : get(from2,length2){if(from2==null)throw new errors2.UnexpectedError("Invalid from: "+from2);if(length2==null)throw new errors2.UnexpectedError("Invalid from: "+length2);return _thing.get_children(from2,length2).map(t2=> {…} length : ƒ length() [[Prototype]] : Object. I know I can format the list as text and then use string.split(","), but is there another way to achieve this directly using the list itself?

The second issue (which I can solve) is that I want to use an object like this: {day1: true, day2: false...} as a parameter, but I’m not sure how to do it. Currently, I’m solving it by passing two lists and building the object in the code, but it doesn’t feel optimal. Any suggestions on a better approach?

Lists are not arrays, they are objects with methods to get the values and total length. It is all explained in the dynamic inline documentation of the editor:

If it’ an action you can use the type “array of keys/values”:

1 Like

thanks bro

1 Like