Related documents

If the source list is a document library, you can allow users to upload related documents by dragging and dropping them onto the parent form.

Related documents with support of quick upload

New form

  1. Pick the source list in the Data Source editor and set filtering option to ‘Show new items only’.
  2. Switch the Related Items control into view mode by setting Quick Edit property to None.
  3. Set Editable property to False.
  4. Assign a unique Css Class to the Related Items control, e.g. ‘related-docs’.
  5. Insert the following code into JavaScript editor:
    fd.updateDroppedDocuments($('.related-docs'), {
      Parent: '{CurrentItem}'
    });

    Replace ‘related-docs’ with the Css Class you set on step 4. Replace ‘Parent’ with the internal name of the lookup field in the source list pointing to the current list that must be populated automatically.

    Notice: if you need a context menu to be able to remove documents, expand View property and replace

    <FieldRef Name="LinkFilenameNoMenu" />
    

    With this:

    <FieldRef Name="LinkFilename" />
    

Edit and Display Forms

  1. Navigate to the source list and add ID as an additional column of the lookup column pointing to the parent list:
    List settings → Columns → Pick the lookup column → Add a column to show each of these additional fields → Pick the ID.
  2. In Forms Designer, pick the source list in the Data Source editor and set filtering option to ‘Filter by form field’.
  3. Set Form Field to ID and List Field to additional column that you added on step 1.
  4. Follow the instruction from the ‘New form’ section starting from the step 2.

Additional materials

JS-framework: updateDroppedDocuments

Find more info in our blog:
Related documents with support of quick upload