Options expression for a select box

I have a really basic drop down where I just need a list from 1-150 where the labels and the values are simply the integers. What I came up with is:

[for i in 1…150 return {“label”: string(i), “value”: i}]

While this doesn’t throw any errors it also doesn’t populate the drop down and simply produces: “No Results”.

Can you upload the form itself?

not sure how to do that.

I gave this a shot myself and i was able to get it working with the following settings

Option Source: Expression

Option Expression:

for n in 1..150 return {"label": "Number " + string(n), "value": n} 

The JSON for the form looks like this:

{
  "executionPlatform": "Camunda Cloud",
  "executionPlatformVersion": "8.6.0",
  "exporter": {
    "name": "Camunda Web Modeler",
    "version": "2c23077"
  },
  "schemaVersion": 18,
  "id": "numbers-1k1bozz",
  "components": [
    {
      "label": "Number to Select",
      "type": "select",
      "layout": {
        "row": "Row_1ncuqsn",
        "columns": null
      },
      "id": "Field_0wtl0tj",
      "key": "number",
      "searchable": true,
      "valuesExpression": "=for n in 1..150 return {\"label\": \"Number \" + string(n), \"value\": n}"
    }
  ],
  "type": "default"
}

This worked great thanks!

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