Custom Field Type: Special – MS Word Merge

From SmartWiki
Revision as of 10:40, 21 August 2013 by Arthur Lathrop (talk | contribs)

Jump to: navigation, search
Click here to peruse our selection of custom fields.

This field type provides the ability to dynamically create an MS Word document from underlying SmartSimple data.

Configuring a Word Merge in SmartSimple is a three-step process:

  1. Create the MS Word document that will be used as the template. (See Adding Form Fields to a MS Word Document for instructions.)
  2. Upload the Word document to a SmartFolder. (See Uploading Word Merge Document to a SmartFolder for instructions.)
  3. This page describes how to create a Custom Field Type: Special - MS Word Merge custom field that maps the SmartSimple fields you wish to merge to the Word template.




Field Options

Option Description Format
Custom Field ID The unique ID number associated with the custom field. Not Applicable
Field Type The list of available Field Types. @fieldtype@
Field Name The name of the field, used internally to reference the user's input; @fieldname@
Caption  The leading question or prologue before the field. @caption@
Display Order  The order (relative to other fields) in which this field is displayed. @displayorder@
Description Definition and general description of the custom field. Will not be displayed. @description@
  • Button Label: Text to be displayed on the field's button. If no text is entered, the system will use a default label. For Word Merge fields, the default label is "Open".
  • Appear Mandatory: Makes the field appear as though it is a required field. Typically used in conjunction with browser scripts, JavaScript Validation or Submit Logic that perform validation.
  • Label Display: Determines the location of the field caption. Options include: Left of Field, Above Field, No Caption, Hide Caption. Note: this option was previously called Label Display. (See examples here.)
  • On New Record: Controls how the field should be displayed until record has been saved once.
    • Always Display: Field will be exposed both before and after the record is saved.
    • Hide on New Record: Field will be hidden until record is saved.
    • Only Show on New Record: Field will be exposed until record is saved, and then it will be hidden. This option is useful for fields that provide instructions for filling out forms before saving.
  • Visibility Condition: See the Visibility Condition Wiki page.
  • Field Permission Matrix: See the Field Permission Matrix Wiki page.
  • Value Storage: Enables linking two different custom fields to the same user data. See Value Stores To page.
  • Role - Field Permissions: These settings allow you to control by Role who is allowed to view and/or modify the field.
  • Status - Field Permissions: These settings allow you to control by the Status of the record whether or not the field can be viewed and/or modified. (Only present within the Universal Tracking Application)
  • Type - Field Permissions: These settings allow you to control by the template of the record whether or not the field can be viewed and/or modified. (Only present within the Universal Tracking Application)


Creating the MS Word Merge Field

Setting the Values

Now that the Word document to be used as the template has been created (step 1) and uploaded to a SmartFolder (step 2), you can now proceed to step 3: creating the MS Word Merge custom field that will be used to dynamically populate the document.

  • In the Values section: the form fields you created on the MS Word document are now assigned by name to the associated SmartSimple Field Names or Field IDs:
signatory=@me.fullname@;
or
datesigned=@#565346#@;
WordMergeValues.png
  • Note: Each Form Field on the MS Word Merge Document should be represented on a different line in the MS Word Merge Field Values section, and each line must end with a semi-colon.
  • The variables used for the MS Word Merge are the same as for a Web Page View Field and can be found at Web Page View Field Variables.
  • Only fields containing text can be used for the Word Merge. Please note that you cannot use image fields, file fields etc.
  • Rich Text fields are not suitable for including in MS Word Merges because of the additional encoding to support formatting.
  • The sequence is not important, as the variables are matched using the bookmark name.
  • The only exception is when SmartSimple variables are merged to a Word table; the table references must be at the bottom of the list of Values. See this page for instructions on configuration.
  • You can assign more than one field from SmartSimple into a single MS Word form field, and include other text and characters:
time=@starth@:@startminute@ @startpmam@; would display in this format: "12:35 pm" in the time form field
or
contractdetails=@duration@ with a monthly fee of $@monthlyfee@; would result in "24 months with a monthly fee of $200" in the contractdetails form field
  • You can include <!--hideifnotfound--> in front of variables that may not be present to ensure nothing is displayed, rather than the variable name.
  • An example would be monthlyfee=<!--hideifnotfound-->@monthly fee@;
  • You can include HTML code embedded within <html></html> tags. The SmartSimple Word Merge engine will apply the HTML formatting to the value before merging to the Word document.
  • Note that HTML code will only function when merging to a single record, not for the batch merge mode.
  • You can use the following special characters in this section to control the output on the MS Word Merge document:
  • ^p = Line break
  • ^t = Tab

Custom Field IDs

You can use the Extract IDs and Display Field Names links in the section to display associated Field IDs and Field Names.
Extract.PNG
See Custom Field IDs for more information.

Smart Folder/File ID

You must also specify the either the Field ID or File ID (as described in the previous step) of the MS Word document.
FileID.PNG

  • If you specify the Folder ID, all documents in the folder will be displayed in a combo-box upon initiating the Word merge. The user can select the document that he/she wishes to create.
Useful if you have several different versions of a document to be generated from the same underlying data
  • If you specify the File ID, that specific document will be used as the template for the Word merge.

Generating the Document

  • In order to generate the document when viewing or editing a record you simply click the button associated with the MS Word Merge.
If a Folder ID was specified in the Custom Field settings you will be prompted to select which document should be used.
  • The document will be dynamically created and the SmartSimple data added.
  • Note: If the user wishes to edit or retain the document he/she may need to use the MS Word Save As feature. Some browsers may cause it to be read only initially.
  • Remember to check the size of the file, header and footer pictures may interrupt the document to merge.


See Also

To set up a Word merge:

Advanced Word Merge Features Include: