Need help creating loop

You could add the options to a js file once and then call them whenever you need to populate a dropdown.

//filename.js file

let tierss = [value1, value 2,...]

export const name = [
  {"label": "" + tierss[0], "value":"0"},
  {"label": "" + tierss[1], "value":"1"},
  {"label": "" + tierss[2], "value":"2"},
  {"label": "" + tierss[3], "value":"3"},
  {"label": "" + tierss[4], "value":"4"},
  {"label": "" + tierss[5], "value":"5"},
];

Then import it and call it for any dropdown that you need values for:


import {name} from 'public/filename.js'; 

$w("#dropTier").options = name;