Dynamically upload multiple documents

Hi All,
I have a requirement regarding SAIL editable grid. I need to upload multiple documents dynamically. So I kept a file upload field in editable grid and trying to capture the value into multiple documents pv. But I was getting some error.

Kindly do the needful,
Thanks

GridFileUpload.doc

OriginalPostID-219182

OriginalPostID-219182

  Discussion posts and replies are publicly visible

Parents
  • See if this code works for you

    load(
    local!items: ri!docNew,
    local!itemsToken,
    a!gridLayout(
    label: "Upload Support Documents",
    labelPosition: "ABOVE",
    headerCells: {
    a!gridLayoutHeaderCell(
    label: "Upload Additional Documents"
    )
    },
    columnConfigs: {
    a!gridLayoutColumnConfig(
    width: "DISTRIBUTE"
    )
    },
    rows: a!applyComponents(
    function: rule!DocumentShowAttributesRowEach(
    items: local!items,
    index: _,
    itemsToken: local!itemsToken
    ),
    array: if(
    or(
    isnull(
    local!items
    ),
    count(
    local!items
    ) < 1
    ),
    {},
    1 + enumerate(
    count(
    local!items
    )
    )
    ),
    arrayVariable: local!itemsToken
    ),
    addRowLink: a!dynamicLink(
    label: "Add Item",
    value: typename(typeof(local!items)),
    saveInto: {
    a!save(
    local!items,
    append(
    local!items,
    save!value
    )
    ),
    a!save(
    local!itemsToken,
    append(
    local!itemsToken,
    save!value
    )
    )
    }
    )
    )
    )
Reply
  • See if this code works for you

    load(
    local!items: ri!docNew,
    local!itemsToken,
    a!gridLayout(
    label: "Upload Support Documents",
    labelPosition: "ABOVE",
    headerCells: {
    a!gridLayoutHeaderCell(
    label: "Upload Additional Documents"
    )
    },
    columnConfigs: {
    a!gridLayoutColumnConfig(
    width: "DISTRIBUTE"
    )
    },
    rows: a!applyComponents(
    function: rule!DocumentShowAttributesRowEach(
    items: local!items,
    index: _,
    itemsToken: local!itemsToken
    ),
    array: if(
    or(
    isnull(
    local!items
    ),
    count(
    local!items
    ) < 1
    ),
    {},
    1 + enumerate(
    count(
    local!items
    )
    )
    ),
    arrayVariable: local!itemsToken
    ),
    addRowLink: a!dynamicLink(
    label: "Add Item",
    value: typename(typeof(local!items)),
    saveInto: {
    a!save(
    local!items,
    append(
    local!items,
    save!value
    )
    ),
    a!save(
    local!itemsToken,
    append(
    local!itemsToken,
    save!value
    )
    )
    }
    )
    )
    )
Children
No Data