Hi all,
How can I cast True or false into yes or no?is there any function to convert like this?
Thanks in advance
Discussion posts and replies are publicly visible
Simply use if()
if(ri!booleanValue, "Yes", "No")
Thank you Sanchit,
But my requirement is little different .I am retrieving some boolean value from expression rule so it gives result as"false" and I want to use this false to some boolean fie
a!localvariables{ local!recomend: a!defaultValue( value: ri!studyMedicalReview.recomend, //retrieved values should go into the field goes as default // default: rule!recomend(ISR_Studyrequest: ri!studyRequest.studyRequestId) ), local!yesNo: { "Yes", "No" }, local!booleanArray: { true(), false() }, a!sideBySideItem( item: a!radioButtonField( label: "Recomended", labelPosition: "ABOVE", choiceLabels: local!yesNo, choiceValues: local!booleanArray, value: local!recomend saveInto: { local!recomend }}
I'm having a hard time understanding your use case. Can you post a screenshot of the error you're getting? What does the value of "local!recomend" evaluate to?
The value of that component must have the exact same data type as the items in choiceValues. Could it be that your local contains a string with the value "false"?
Hi Stefan,
Choice values contains local!booleanArray: { true(), false() } these values but from the rule I am trying to place "false"(which is also boolean value) in the local!recomend when the ri!studyMedical.recomend is blank.
Many thanks
hi Sirio, in value parameter of radio button field , just have null check in you radio button field like below,
a!radioButtonField( value:if( a!isNullOrEmpty(ri!studyMedical.recomend), false, ri!studyMedical.recomend )
Hi Gopal Thank you for the reply.
But how can use the retrieved value from rule!recomend in the radio field when the ri!studyMedical.recomend is empty with the above code