In my form, users should be able to select a document to upload and a corresponding document type, which they will pick from a drop-down. I'd like them to be able to upload multiple document-doctype pairs at once using a collection. However, I'll need to split out the document types (which by default are all listed in one field since it's submitted in a collection).
My plan for this is to:
- Record the ID of the Forms instance on each document that's submitted, and use that to find all the docs that were submitted through that instance
- Order those search results by Entry ID, ascending...
- so that I can cycle through each entry ID, incrementing an index value each time, so I can match each document to its correct document type
My questions regarding this process are:
- This process breaks unless the documents in a collection are submitted in the same order every time. Can I always be sure they will hit the repository in the same order?
- Is this too complicated? Is there an easier way of accomplishing my goal, that I'm not seeing? This is a format that we'll likely be using a lot in the future, so it needs to be airtight.
Thanks!