How can I cast True or false into yes or no?

Certified Associate Developer

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

Parents
  • Simply use if()

    if(ri!booleanValue, "Yes", "No")

  • 0
    Certified Associate Developer
    in reply to Sanchit Gupta (Xebia)

    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
                        }}
    ld in the interface .I have tried the above code but it giving error as choice values are yes or no but you are using false value.so How can I overcome this issue

Reply
  • 0
    Certified Associate Developer
    in reply to Sanchit Gupta (Xebia)

    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
                        }}
    ld in the interface .I have tried the above code but it giving error as choice values are yes or no but you are using false value.so How can I overcome this issue

Children