Can below code be optimized further or written without load()? =load(

Can below code be optimized further or written without load()?

=load(
/* ri!savedValue is a Text type */
local!tempLocalVariable: if(rule!APN_isBlank(ri!savedValue), {}, split(ri!savedValue, ";")),
a!checkboxField(
label: "Sample Checkbox",
choiceLabels: {"a1","b2"},
choiceValues: {"a1","b2"},
value: local!tempLocalVariable,
saveInto: ri!savedValue
)
)

PS: ri!savedValue cannot be changed to multi value text.

Thanks,
Praveen

OriginalPostID-140016

OriginalPostID-140016

  Discussion posts and replies are publicly visible

Parents
  • Hi Chase,
    Thanks for replying. I'm aware of all three points which are pretty valid. In my scenario the field I need to save into is not a multival but a singleval text type and I need to save/read multiple values in/from it. Hence the above workaround.

    Below is the alternative code (which I prefer) but it fails with an error. Hence thought I would ask in here if anyone had done similar thing before.

    a!checkboxField(
    label: "Sample Checkbox",
    choiceLabels: {"a1","b2"},
    choiceValues: {"a1","b2"},
    value: if(rule!APN_isBlank(ri!savedValue), {}, split(ri!savedValue, ";")),
    saveInto: ri!savedValue
    )
    )
Reply
  • Hi Chase,
    Thanks for replying. I'm aware of all three points which are pretty valid. In my scenario the field I need to save into is not a multival but a singleval text type and I need to save/read multiple values in/from it. Hence the above workaround.

    Below is the alternative code (which I prefer) but it fails with an error. Hence thought I would ask in here if anyone had done similar thing before.

    a!checkboxField(
    label: "Sample Checkbox",
    choiceLabels: {"a1","b2"},
    choiceValues: {"a1","b2"},
    value: if(rule!APN_isBlank(ri!savedValue), {}, split(ri!savedValue, ";")),
    saveInto: ri!savedValue
    )
    )
Children
No Data