I would like to have a radio group where the size of the array is dynamic. I know I can use a script transform on the “radios” property, but I am not sure how to actually create the “radios” dataset. For example, I want to enter “3” and dynamically have a radio group with 3 buttons in it. Any ideas?
Use a transform. In this case I’m transforming the constant value 3
out of an expression, but it’d be easy to refer to a property elsewhere instead:
The transform is pretty simple:
return [
{
"text": "Button %s" % (i+1),
"selected": False,
"value": "Button %s" % (i+1),
} for i in range(value)
]
1 Like
That works, thanks!
I learnt something new in Python today! from a post 7 months ago… specifically the for loop part to create things as you did
1 Like
?? That’s just a list comprehension spread over multiple lines. ??
1 Like
Oh… yes… so it is. It must have looked different on my phone
1 Like