What is the best practice to save mutiple cdt at the same time?

I am creating a form where the User can attach files, I have created a section which included input fields and upload document fields. The user should have option to add multiple files with the metadata. 

(when the user clicks on add more files, then It should open up another section with all the fields)

I know I can use loop in the process model but is there any other best way to do it?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    I would create a reference table that stores the foreign key of the parent CDT along with the ID of one document.  You would then create a new sub CDT with that structure.  Part of whatever CDT you're now using should be a list of type newDocumentCDT (or whatever you call it).

    You can then save the list with a write to datastore node, or even save the whole structure at once.  I believe Appian can handle properly saving the individual nodes of an Array member of a CDT while it saves that CDT.  If you just save the list, just click the "Multiple" checkbox.  If the input is a single value, it saves a single row.  If it's a list, it automatically saves multiple rows.

Reply
  • 0
    Certified Lead Developer

    I would create a reference table that stores the foreign key of the parent CDT along with the ID of one document.  You would then create a new sub CDT with that structure.  Part of whatever CDT you're now using should be a list of type newDocumentCDT (or whatever you call it).

    You can then save the list with a write to datastore node, or even save the whole structure at once.  I believe Appian can handle properly saving the individual nodes of an Array member of a CDT while it saves that CDT.  If you just save the list, just click the "Multiple" checkbox.  If the input is a single value, it saves a single row.  If it's a list, it automatically saves multiple rows.

Children
No Data