Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Warning

One key factors that makes Actionstep so powerful is the extent to which we allow our users to customize their systems. While most of our customization features don't require any understanding of programming or scripting languages, there are a few features within the program which allow you to manually manipulate things like HTML and PHP. These subjects are considered advanced topics and as such customers who use them should do so with the understanding that troubleshooting issues with HTML and PHP is outside of the scope of support. 


Calculated merge fields allow you to use a scripting language (PHP) to perform calculations. Creating calculated merge fields is an advanced topic and requires a some understanding of computer programming and in particular PHP.  However it is fairly easy to create simple calculations by performing simple math on variables. 

Info

Note for security reasons only a limited subset of the PHP commands are available.

A calculated merge field is typically used when you need to add a new field to a document that is based on a calculation of existing fields. For example if you have designed a workflow for a property settlement you may need to calculate the rates apportionment on settlement day by dividing the amount already paid by how many days the new buyer will benefit from those rates after settlement day.  This amount usually gets added to the final amount payable at settlement.  This is easily achieved with a calculated merge field.

For information on how to set these up you can either see the below video or the text beneath the video.

Widget Connectorurlhttps://vimeo.com/223064910

Table of Contents

Creating a new calculated merge field

From the top navigation bar go to Admin / "Document Templates" / "List of Merge Fields". This will show a list of all available merge fields in the system.  

Tip
Tip: If you just want to see existing calculated merge fields then filter the list on "Data Source" = "Calculated Field".

...

As you saw in the previous examples you can use custom data fields in your expressions. To make this even easier there are two special variable names which give you direct access to single-row and multi-row data collection fields.

Accessing single-row data fields

Code Block
$singleRowData['data-collection-name']['data-field-name']

So in the date example above we could use this alternative syntax to access the settlement date:

Code Block
$settlement = date('Y-m-d', strtotime($singleRowData['conv_settlement']['settlement_date']));

Accessing multi-row data fields

Code Block
$multiRowData['data-collection-name'][0…n]['data-field-name']

...