File Upload ForEach Looping

I want to have users upload files within a foreach - ie like an array of arrays. Think a use case like an apartment/landlord asking for multiple documents for same person ie banking will have multiple documents, ID will have multiple docs, references, etc. But all within the same ForEach in the interface. Each element of the ForEach has a different file upload instance. Thoughts?

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Senior Developer
    in reply to chazmjenkins

    How are you storing these rows? Could you share the structure/data model?

    My approach

    Reference data

    REF_ID REF_VALUE REF_TYPE Sequence IS_ACTIVE
    1 Income File_Type 1 1
    2 Reference File_Type 2 1
    3 Id File_Type 3 1
    4 Vehicle File_Type 4 1

    Table 1

    ID NAME IS_ACTIVE
    1 XYZ 1

    Table 2

    ID TENANT_ID APPIAN_DOC_ID FILE_CATEGORY_REF_ID IS_ACTIVE
    1 1 11424 2 1
    2 1 11432 2 1
    3 1 11553 4 1
    4 1 11323 1 1
    5 1 12321 2 1
  • I can't share the code exactly but it's something like this we're doing now - 

    contents: a!cardLayout(
    contents: {
    a!forEach(
    items: ri!appianCommunityDocs,
    expression:
    {

    a!columnsLayout(
    columns: {
    a!columnLayout(
    contents: a!columnsLayout(
    columns: {
    a!columnLayout(
    contents: {
    a!sideBySideLayout(
    items: {
    a!sideBySideItem(
    item: a!dropdownField(
    choiceLabels: ...etc

     - all the card layout code - 

    ...saveInto: {
    a!save(
    ri!appianCommunityDocs,
    append(ri!ri!appianCommunityDocs, save!value)
    ),
    a!save(
    target: local!tenantDocs,
    value: append(
    local!tenantDocs,
    a!map(documents: {}
    ),
    )
    )

    I am troubleshooting the local!tenantDocs variable but maybe the interface needs to be converted to editable grid instead.

  • a!fileUploadField(
    value: local!tenantDocs,
    saveInto: local!tenantDocs,