1
0
-1

I have a form that contains an email address field. When the user saves the form, they are presented with the save dialog (from the template) which also contains an email address field, in case the user hasn't reached the email field in the form.

I want to add a data field to the form which can read the values of the email field in the form and the email field in the save dialog, and implement some logic to choose which of these emails to use. This field will be mapped to the 'Contact Email XPath' in TM.

How can I read the email field from the template within the form? Do I need to add an extension point in the template? This seems unnecessary when all I need is to read the existing fields in the template...

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Hi Chris, 

      It sounds like you are trying to reference a field that exists in the template structure but is not accessible in the form structure (i.e. it is not within an extension point). Assuming this is the case...

      You won't be able to see the field in the Maestro UI when defining your business rule, but this does not mean you can't reference it. If you know the field ID (which you can obtain from the template or from reviewing the HTML source of the published form) you can reference it in your business rule as you normally would:

      data.{fieldId};

      Alternatively you can update the template to make the body portion of the save dialog an extension point allowing you direct access to the components (which I am surprised you don't have already).

      Regarding your setup, it is quite common for the email address field in the form to be the primary email address field, and for the one on the save dialog to take its value from this using a calculation rule. This way the customer is not asked to re-enter their email address again on the save dialog (as it is pre-filled from the primary one) but they can override it if they want to.

      Hope this helps!
      Ryan

        CommentAdd your comment...