Is there any way to pre-populate documents in file upload field?

Requirement: Suppose if there are 10 rows in an editable grid of which one column is file upload file. If I upload a document in any of the rows for the first time, the file upload fields of other rows needs to be populated with the same document uploaded. After that whenever a document is updated in any of the rows, the new document should be saved. Kindly suggest a way. TIA

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    Hi ARUN,
    As you are using the editanble grid, I assume you are using a list type variable for storing the documents and you store the uploaded doc at the specified index. while saving the document check if the list is empty. If the list is empty iterate the document to the length of list( repeat(length(list),document) ) and save it into the list. This ways you are storing the reference of the doc in all the indexes and if you update at the document at any index only that index will be updated and all other indexes remains like that.

    saveInto:if(
    rule!APN_isEmpty(
    list
    ),
    a!save(
    list,
    repeat(
    length(
    list,
    doc
    )
    )
    ),
    a!save(
    list[fv!index],
    save!value
    )
    )
Reply
  • 0
    Certified Lead Developer
    Hi ARUN,
    As you are using the editanble grid, I assume you are using a list type variable for storing the documents and you store the uploaded doc at the specified index. while saving the document check if the list is empty. If the list is empty iterate the document to the length of list( repeat(length(list),document) ) and save it into the list. This ways you are storing the reference of the doc in all the indexes and if you update at the document at any index only that index will be updated and all other indexes remains like that.

    saveInto:if(
    rule!APN_isEmpty(
    list
    ),
    a!save(
    list,
    repeat(
    length(
    list,
    doc
    )
    )
    ),
    a!save(
    list[fv!index],
    save!value
    )
    )
Children
No Data