Index
ChooseFile
Video Courses
Watch structured video courses
Knowledge Base
Visit our User Forum for discussions & solutions
ChooseFile
ChooseFile places a control on the interview which enables the user to choose one or more files at run time, and places the name of each chosen file into a data element. Those file names can then be used by AttachToEmail, so that the user can attach their own documents to the email which the template assembles.
At present ChooseFile caters for use with AttachToEmail.
Parameters
«ChooseFile(DataElement,FileTypes,SourceLocation,AllowMultiSelect,RepeatingElement)»
| Parameter | Description |
|---|---|
| DataElement | Required. The name of the data element into which the name of the chosen file will be placed. |
| FileTypes | The file types which the user is permitted to choose, for example 'docx' or 'pdf'. Leave the parameter empty, or supply *, to permit any file type. |
| SourceLocation | Where the user may choose the file from – Cloud, Upload or iManage. See Source Location below. |
| AllowMultiSelect | Supply true to allow the user to choose more than one file. When this is done, the fifth parameter must also be supplied. |
| RepeatingElement | The repeating data element into which the chosen files must be placed, in the form Repeater/Element. This is required when multi-select is allowed, because each of the chosen files becomes one repeated item. |
The parameters can be completed in the Command Assistant rather than typed by hand.

Source Location
The third parameter governs where the user is invited to look for the file.
- Upload – the user uploads a file from the machine on which they are working.
- Cloud – the user browses the files already held in the XpressDox cloud file system.
- iManage – the user chooses a document from iManage.
With Cloud, the control offers the user the cloud file system as well as the option of uploading a file of their own.

With iManage, the user chooses the document using the familiar Matters and Clients navigation.

In the desktop interview, Upload presents a box onto which the user can drag and drop the file.

Example – attaching several chosen files to an email
Here the user may choose more than one file, and every file they choose is attached to the email which the template assembles. Because multi-select is allowed, the fifth parameter names the repeating data element Attachment, and a ForEach then works through the files one at a time.
«ChooseFile(EmailAttachment,'',Upload,true,Attachment/EmailAttachment)»«ForEach(Attachment)»«AttachToEmail(EmailAttachment,AttachmentFileName,false())»«End(Attachment)»«CaptureInGrid(Attachment)»
Note the two ways in which the data element is written. The fifth parameter uses the Repeater/Element path notation, which is how a repeating data element is referred to when it is being declared. Inside the ForEach, the element is referred to by its own name, because the ForEach has already established the repeat as the context.
CaptureInGrid causes the chosen files to be presented to the user as rows in a grid, which makes a list of several attachments considerably easier to review than a set of stacked repeater panels.
See AttachToEmail for the meaning of its second and third arguments.