Expand my Community achievements bar.

How to iterate over a forms image fields

Avatar

Former Community Member
I have a form built in Designer allowing users to upload multiple images. The number varies and the fields are implemented via subforms. First question....



1. what do image fields get mapped to in Workflow ? document variables ?

2. how do you iterate over lists of items such as those in subforms



Thanks
4 Replies

Avatar

Level 9
Hi Rob



re: what do image fields get mapped to: I haven't worked with Image fields, but I can say that they won't automatically get mapped to document variables. I suspect that the image is stored in some sort of hex encoded format with the XML document.



re: iterating over form items. It's quite difficult to iterate over form items. What exactly do you want to do with these images? Store them in the database or in a series of files?



Howard

http://www.avoka.com

Avatar

Former Community Member
My question re: iterating has more to do with how are repeatable data items represented in the Workflow data model. The classic example is a purchase order with a varying number of products. What the best way to set and act on varying lists of items instead of single item vaues which are easy to set/get.

Avatar

Level 9
Hi Rob

The data items are represented in the form data as a repeating sequence in the underlying XML. The exact structure of this will depend on whether you've defined an XML schema, how you've bound it, etc. In other words, something like:

ACME


123
3
12.95


444
2
99.95




If you'd like to find out what the actual data in your form-variable is, use our free VariableLogger QPAC at: http://www.avoka.com/avoka/qpac_library.shtml

In terms of iterating over these items, there aren't any standard QPACs that are repeating-sequence-aware. If you use the standard xpath expression browser to select one of these items, you'll always just get the first one. (Note: this is as things stand as of V7.0.0 - I have not yet upgraded to 7.0.1 to see if there's anything different, although I doubt it.)

However, it is possible to build QPACs that are sequence-aware. We have one, for example, that will iterate over a sequence, and map each of the elements it finds to a database table. We have another in development that will iterate over a sequence and initiate a sub-process for each one (passing in the values such as code/qty/price into the sub-process). We have yet another that will add a new row to a repeating element based on the current value of other variables in your process. Etc...

So the question back to you is: what is it that you're trying to do with your repeating sequence?

Regards,
Howard
http://www.avoka.com

Avatar

Former Community Member
Image fields in forms are stored in form variables just like any other field in a form depending on how you've set the binding for them. If you've chosen to embed the image in the form then the binary image data is stored in the XML, otherwise an href to the image file is stored.



P.S. Howards description is valid for 7.0.1 as well as for 7.0.0.



Chris

Adobe Enterprise Developer Support