Why properties.textList.get() return empty?

Hi everyone,
In a server side action for a plugin I face a behavior that I don’t understand.

with a code like this:

function(properties, context)
    
    let sss = properties.main_list;
    let ddd = properties.main_list.get(0,3);
    let aaa = properties.main_list.length();
    let eee = sss.length;

    return { "new_list": sss }
}

it return the right list which is:
a
b
c
d

but when trying to return ddd:

function(properties, context) {
    
    let sss = properties.main_list;
    let ddd = properties.main_list.get(0,3);
    let aaa = properties.main_list.length();
    let eee = sss.length;

    return { "new_list": ddd }
}

it return an empty list.

and when trying to return those things:

function(properties, context) {
    
    let sss = properties.main_list;
    let ddd = properties.main_list.get(0,3);
    let aaa = properties.main_list.length();
    let eee = sss.length;

    return { "new_list": [sss[0], ddd[0], aaa.toString(), eee.toString()] }
}

it return those values (the first and the second are empty):
EaseUS_2023_08_27_14_28_03

why it return empty values with ddd, sss[i], and ddd[i]? and what is the meaning of the values it return for .length and .length()?

this is the main list settings:

and this is the new list settings:

and the data I am trying to pass is a list of names (text field) of data type

You need to use async/await syntax if you are using the most up to date version of the plugin builder

https://manual.bubble.io/account-and-marketplace/building-plugins/updating-to-plugin-api-v4#.length-updated-plugin-api

Is the builder version a thing that I can choose or control?

thank you very much, I have added two “await” and now it seems work well:

let ddd = await properties.main_list.get(0, await properties.main_list.length());
1 Like