You need to sign in to do that
Don't have an account?
Tanmay Choudhari
How to default dynamic value in radio button depending upon choice available
I have a record choice set and it is used as a choice in radio button in a screen component. The other choice is None.
On the basis of number of records available in record choice set, if only one record is available then I want to default that as a selected choice. If there are more than one records available then I want to default None choice and let user select the required choice.
Tried approach - created a formula variable with if logic. In that checked if record choice set contains semi-colon means more than one records are available(CONTAINS({!tField},";")). If true then None choice, if false record choice set as a choice.
This formula is not working any other approaches is appreciated. Thanks
On the basis of number of records available in record choice set, if only one record is available then I want to default that as a selected choice. If there are more than one records available then I want to default None choice and let user select the required choice.
Tried approach - created a formula variable with if logic. In that checked if record choice set contains semi-colon means more than one records are available(CONTAINS({!tField},";")). If true then None choice, if false record choice set as a choice.
This formula is not working any other approaches is appreciated. Thanks
To achieve your desired functionality, you can use a formula expression in the "Default Value" property of the radio button in your screen component. The formula should check the number of records in the record choice set and set the default value accordingly.
Please try with the above formula .
By using this formula expression, the radio button will be pre-selected with the appropriate default value based on the number of records in the choice set. If there's only one record, it will be selected. If there are multiple records, the "None" choice will be selected, allowing the user to make a selection manually.
If this helps , please mark this as Best Answer.
Thank you.
{!IF(LEN({!OrderableProductChoiceSet1}) = 1, {!OrderableProductChoiceSet1[0].value}, {!None})}
But sadly it is not working as expected. I tried with different formula also but didn't worked.
IF( CONTAINS({!OrderableProductChoiceSet1}, ";") , {!None}, {!OrderableProductChoiceSet1})
Can you try with this one :
Hope this helps !
Thank you.