Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to create an input block and use a dropdown. Does anyone know how to format an "array of {id
-name
} pairs" as mentioned in the help?
Hi @tan123qlik ,
There are 2 approaches here.
1) When the data for the dropdown can vary each run (eg when it comes from a connector)
Build the list by using variable blocks of type List & type Object. The loop block in the example should be replaced by a List block that returns a list of records you want to use to populate the dropdown.
2) When the data for the dropdown is static
Hard code the list of items as JSON text and use the "Object" formula to transform it into a list.
I've attached an exported automation that contains both examples.
Kind regards,
Emile
Hi @tan123qlik ,
There are 2 approaches here.
1) When the data for the dropdown can vary each run (eg when it comes from a connector)
Build the list by using variable blocks of type List & type Object. The loop block in the example should be replaced by a List block that returns a list of records you want to use to populate the dropdown.
2) When the data for the dropdown is static
Hard code the list of items as JSON text and use the "Object" formula to transform it into a list.
I've attached an exported automation that contains both examples.
Kind regards,
Emile
Thanks Emile, that helped. Now I understand the "array of pairs" but my input doesn't show what I expected. I have done
But my input looks like this. I was expecting only the names of the apps in the list.
In the object, the keys must be the literal words "id" and "name". So you'll need to add 2 key/value pairs:
Emile
Thanks, I missed that in you first answer.