Conditional Coding on field value

As a user I would like to be able to have the output reflect paragraph a if a field value = x or paragraph b if not.

There are several use cases and examples.

If age =>65 display field x or following paragraph

Requires introducing a little more complex code but will unlock the potential

Hi @Cath_Perry ,

DocuGen supports conditional check. You can use IF() or SWITCH() functions for conditional checks.
For example: If you want display any column value for the same row when age = 65, you can use following formula:
IF({age} = 65,{Field X},{Field Y})

Thanks!

1 Like

Learned something new today that I could definitely use in the near future!

1 Like

I am using monday.com with the DocuGen add-in. I tried this in a Word document template, and it didn’t work:

<<IF({column_firstrow:Col} = “true”,“hello”,“”)>>

It did not work. Did I do something wrong? Or does this not work with DocuGen’s monday.com add-in?

Hi @Bill_Winett
The formula should be a column in your monday.com board. In other words, the conditional logic will reside on your board; DocuGen will just insert whatever value the formula column calculates.
Let’s say you would like to sell widgets to customers in California and Nebraska. You want to generate order forms using DocuGen. The order form contains a paragraph that should be included when the customer is in California, and another paragraph that should appear when the customer is in Nebraska.

  1. Make sure you have a column that indicates the customer’s state. Let’s call it ‘State’
  2. Create a formula column, let’s call it ‘State T&C’:
    if({State} = ‘California’, ‘This is the wording for CA…’, IF({State} = ‘Nebraska’, ‘This is the wording for NE…’, ‘’))
  3. Insert this placeholder into your document: <<column_firstrow:State T&C>>

I hope this works for you!

1 Like