You are viewing limited content. For full access, please sign in.

Question

Question

Is submission order for documents in a collection always the same in Forms?

asked on May 23, 2019

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:

  1. 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
  2. Order those search results by Entry ID, ascending...
  3. 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:

  1. 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?
  2. 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!

 

Capture.PNG
Capture.PNG (25.09 KB)
0 0

Answer

SELECTED ANSWER
replied on May 23, 2019 Show version history

Have you tried setting the Document Type to a metadata field when you store the document(s)? With tables and collections you can use a row index to store the file and associate it with a field from the same part of the collection.

For example, in the Save to Repository task use something like this in the metadata

{/dataset/Your_Collection/Document_Type[Row()]}

Select your Document Type variable from the collection, and add [Row()] at the end before the bracket; this is a function that automatically detects the associated row, so add it as-is.

0 0
replied on May 23, 2019

Perfect, that does it! Thanks!

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.