#SAIL Hello ! I'm trying some SAIL tutorials, but one

#SAIL

Hello !

I'm trying some SAIL tutorials, but one of them is not working. It's the following:
forum.appian.com/.../SAIL_Recipes

I really need this, since SAIL Forms doesn't have the grid component as we have on Portal Forms.

Trying as a test rule, the following error appears:
"[Lorg.json.JSONObject; cannot be cast to [Lcom.appiancorp.suiteapi.process.TypedVariable;"

And trying as a process model:
"Erro de avaliação de expressão in rule 'multipletextcomponents': Error evaluating function fn!apply :
Expression evaluation error in rule 'ucdynamicfieldeach' (called by rule '27917') at function a!textField:
Invalid index (1) for list: valid range is empty"

I did everything the Recipe said, but unfortunatetly couldn't get it to work. So if someone already tried
it with success, please let me know what am I doing wrong.

Thanks...

OriginalPostID-99840

OriginalPostID-99840

  Discussion posts and replies are publicly visible

Parents
  • Patty, here they are:

    ucDynamicFieldsUpdateArray:

    =with(
    local!newGuestList: updatearray(ri!guests, ri!index, ri!newValue),
    if(isnull(local!newGuestList[count(local!newGuestList)]),
    local!newGuestList,
    append(local!newGuestList, "")
    )
    )

    ucDynamicFieldEach:

    =a!textField(
    label: if(ri!index=1, "Guest Names", ""),
    refreshAfter: "KEYPRESS",
    value: ri!guests[ri!index],
    saveInto: ri!guests << rule!ucDynamicFieldsUpdateArray(ri!index, ri!guests, _)
    )

    multipleTextComponents:

    =a!formLayout(
    label:"SAIL Example: Add Text Components Dynamically",
    firstColumnContents: {
    /* The guests array is passed to the rule directly, creating a partial function */
    a!applyComponents(
    function: rule!ucDynamicFieldEach(index: _, guests: ri!guests),
    array: 1+enumerate(count(ri!guests))
    )
    },
    buttons: a!buttonLayout(
    primaryButtons: a!buttonWidgetSubmit(label: "Submit")
    )
    )
Reply
  • Patty, here they are:

    ucDynamicFieldsUpdateArray:

    =with(
    local!newGuestList: updatearray(ri!guests, ri!index, ri!newValue),
    if(isnull(local!newGuestList[count(local!newGuestList)]),
    local!newGuestList,
    append(local!newGuestList, "")
    )
    )

    ucDynamicFieldEach:

    =a!textField(
    label: if(ri!index=1, "Guest Names", ""),
    refreshAfter: "KEYPRESS",
    value: ri!guests[ri!index],
    saveInto: ri!guests << rule!ucDynamicFieldsUpdateArray(ri!index, ri!guests, _)
    )

    multipleTextComponents:

    =a!formLayout(
    label:"SAIL Example: Add Text Components Dynamically",
    firstColumnContents: {
    /* The guests array is passed to the rule directly, creating a partial function */
    a!applyComponents(
    function: rule!ucDynamicFieldEach(index: _, guests: ri!guests),
    array: 1+enumerate(count(ri!guests))
    )
    },
    buttons: a!buttonLayout(
    primaryButtons: a!buttonWidgetSubmit(label: "Submit")
    )
    )
Children
No Data