Back

How to Create Simple and Complex Calculated Fields in Popdock

Published: Feb 14, 2025
Post Author Written by Joseph Barb

One of the most significant advantages of calculated fields is their ability to unlock hidden insights within your data. For instance, if your data doesn’t quite fit your needs and you need to do some transformation or calculations then you may be looking for something simple like these examples:

The examples below use C# and Popdock Script. Popdock provides other field language options to create calculated fields depending on the connector.

Combining the values of two fields:
  • Formula: {First Name} + “ “ + {Last Name}
  • What it does:  This is looking at the 2 fields for a first name and a last name. The formula simply combines the two and then adds a space. So, if your data is returning these values into two separate fields you can simply combine them in a single calculated field.
Removing taxes from your total:
  • Formula: {Total} – {Tax amount}
  • What it does:  This will subtract the Tax Amount value from the value in your Total field.

In certain scenarios, adding logic to your formula becomes necessary when outcomes depend on specific field values. Popdock’s custom calculated fields manage such complexity with C# formulas and its proprietary Popdock Script. While learning some programming language might be required for C# formulas, Popdock simplifies the process with its Add Function feature, offering a range of options. Below is an example of a calculated field achievable with both C# and Popdock Script to achieve the same outcome:

Check the Due date field to see if the transaction is over 90 days past due and if it is show the Originating document amount else show 0:
  • C# Formula:  (DateTime.Now – {Due date}).TotalDays > 90 ? {Originating document amount} : 0
  • Popdock Script Formula:  If(DaysBetween({Due date}, Today) > 90, {Originating document amount}, 0)
If you needed to add more logic, Popdock’s calculated fields can handle it:
  • C# Formula:  {Payment terms ID} == “COD” && DateTime.Now > {Due date} ? {Originating document amount} : {Payment terms ID} == “NET30” && (DateTime.Now – {Due date})?.TotalDays > 30 ? {Originating document amount} : {Payment terms ID} == “NET60” && (DateTime.Now – {Due date})?.TotalDays > 60 ? {Originating document amount} : 0
  • Popdock Script Formula:  Ifs({Payment terms ID} = “COD” and Today > {Due date}, {Originating document amount}, {Payment terms ID} = “NET30” and DaysBetween({Due date}, Today) > 30, {Originating document amount}, {Payment terms ID} = “NET60” and DaysBetween({Due date}, Today) > 60, {Originating document amount}, 0)

Questions on creating a calculated field? Contact support@eonesolutions.com.

Feeling stuck? Get the support and guidance you need to help you power through any data challenge

We're on your integration team. Connect with our people and let us know how we can help you.