Solved

Conditional Formatting in word document - Null fields

  • 15 May 2019
  • 5 replies
  • 198 views

I am struggling to write an if then statement for a null condition.  Here is what i am trying to do:

 

If all fields have content in Salesforce, show this way:

Attendee Name, Attendee Title 

 

If there is no title in Salesforce, show this way:

Attendee Name 

 

Here is the code I am putting in Word 

<<Attendee_Attendee_First_Name>> <<Attendee_Attendee_Last_Name>> { IF <<Attendee_Title_Form>> = “” “” “, <<Attendee_Title_Form>>” *MERGEFORMAT}

 

When I run the report - I get this:

First Last IF Title = “” “” “, Title”

 

or if there is no title - I get this:

First Last IF  = “” “” “,”

 

I can't figure out how to write the code in Word.  Any help would be appreciated

 

Thank you,

Karen Himes

Western Energy Institute

icon

Best answer by DocGenVinnie 16 May 2019, 18:47

View original

5 replies

@himes  You need to wrap your field tag in quotes for your statement to work. Try this:

 

<<Attendee_Attendee_First_Name>> <<Attendee_Attendee_Last_Name>> { IF "<<Attendee_Title_Form>>" = “” “” “, <<Attendee_Title_Form>>” *MERGEFORMAT}

 

If that doesn't work, attach your template and I can take a look.

First off - thank you so much for responding!  I put the code in using your suggestion and still get the output with the code in it.  I'm attaching the template and the product for you to take a look at.

Here is the product of the template when i run it.

Badge +7

Try this.  You need to insert the text by creating a formula field. 


 


https://www.youtube.com/watch?v=mFs0rbIxz3Y


 


 

This is EXACTLY what I needed!!  You have opened up so many opportunities for me.  Thank you so much!  It worked perfectly.

 

Thank you,

Very happy DocGen user,

Karen

Reply