Dynamic Default Value

How can i make default values of a field change each time when i change the options in another field.

For example,
When i choose ‘Apple’ from the fruits option, in default the Color text field should come as ‘Red’
similarly when i choose ‘Mango’, the Color text field should show ‘Yellow’.

How can i achieve this? I have a list of 40 options.
I want it to be in default values because i also want the users to be able to edit the text fields.

1 Like

I’m also wondering the same thing. Is this possible? We’re using a form.

So far, I’ve attempted using a template column, which doesn’t work (as computed column data is not computed until after forms are submitted).

I’ve also tried this by creating a duplicates of my component, with conditional visibility depending on which prior option is selected.

What I mean, is To use the example above, if I selected ‘Apple’, then the component with the default value selected as ‘Red’ would become visible. Likewise, if I selected ‘Mango’, the duplicate component with default value set to ‘Yellow’ would now be visible instead.

Unfortunately, this didn’t work. Duplicate components with different default values won’t work. It will default all of the duplicated components to the default value of the last component on the page, even if only one of them ever became visible.

Is there any other known methods of doing this? I suppose we could make a custom form… maybe that’s what actually needs to happen–it would just seem like a shame that we couldn’t have more native form capabilities.

You’ll need a custom form for that.

1 Like

If it’s something that changes based on another value on the same screen, I don’t think a custom form works. If I recall right, entry components don’t have default values if you add them on a details screen.