String substitute is not working in a!paragraphField( ) function saveInto

Hi,

I am trying to substitute few characters from input string and store/display in the rule input variable (i.e. target).

SAIL: 

a!localVariables(
{
a!buttonArrayLayout(
buttons: a!buttonWidget(
label: "Add",
value: "Add",
saveInto: a!save(ri!target,"2323432345,2343234543,4433443323")
)
),
a!forEach(
items: ri!target,
expression: a!paragraphField(
label: "Target",
labelPosition: "COLLAPSED",
value: substitute(fv!item, ",", char(10)),
saveInto: a!save(fv!item,substitute(fv!item, ",", char(10))),
required: true,
refreshAfter: "UNFOCUS",

)
)
}
)

In the image above I have used substitute( ) function to replace all comma ( , ) character with char(10) but as you can see the display value is converted to desired format where as the data stored in rule input remains the same (comma separated).

Please help me convert the data : 

From : 

2323432345,2343234543,4433443323

To : 

2323432345
2343234543
4433443323

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    I'm a little unclear what you're attempting to accomplish.  You're treating your Rule Input like an array in one spot, but as you can clearly see from your screenshot of its current value, it only has a single value, and there's nothing in the save operation that would cause it to save multiple values.

    Note also that the SaveInto for a field only executes after a user interacts with it - so the value stored in your Rule Input will remain static until you edit the value in the field.  I'd guess that once you try editing the field (like add a character to one of the numbers), it might save the new version with char(10) linebreaks instead of the commas.  But the substitute() function will do nothing up until that point at least.

Reply
  • 0
    Certified Lead Developer

    I'm a little unclear what you're attempting to accomplish.  You're treating your Rule Input like an array in one spot, but as you can clearly see from your screenshot of its current value, it only has a single value, and there's nothing in the save operation that would cause it to save multiple values.

    Note also that the SaveInto for a field only executes after a user interacts with it - so the value stored in your Rule Input will remain static until you edit the value in the field.  I'd guess that once you try editing the field (like add a character to one of the numbers), it might save the new version with char(10) linebreaks instead of the commas.  But the substitute() function will do nothing up until that point at least.

Children
No Data