cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

IF condition to display a Table in Word document

Jump to solution

Hi Team,

In word document which we have prepared I want to use IF condition in such a way that if the condition is True then it displays a table and if not then it shouldn't get displayed. What i did was created an IF statement from Insert>Quick Parts>Field i.e. IF Expression1 <> "" "Success" "Failure". After this I edited this IF condition to the image inserted below.IF condition statement

So what does the above snippet suggest that if the Tagger field is not "" then it should display the table else it shouldn't. But when I am trying to do in such way i am getting failure. So can the team help me in suggesting that how can i display a table in if condition as per the image snippet attached above.

Reply
7 Replies
Workflow Hero

Re: IF condition to display a Table in Word document

Jump to solution

You are really close.  You just need to put the tags in the first part of the condition in quotes.  Here is an example from our support site for conditional text.

Reply
Workflow Hero

Re: IF condition to display a Table in Word document

Jump to solution

Hey thanks for the reply!

Can you share the code snippet depicting the same as such i tried with the same way but not getting success.

0 Kudos
Reply
Workflow Hero

Re: IF condition to display a Table in Word document

Jump to solution

Pratik, here is a sample document that should work in any org.  This is a conditional table based on Account Billing State. "CA" will show a CA table and any other state would show the OtherState table.

Conditional Table

Reply
Workflow Hero

Re: IF condition to display a Table in Word document

Jump to solution

‌,

Don't forget to right click and update otherwise your changes won't take effect.

Cheers,

Reply
Workflow Hero

Re: IF condition to display a Table in Word document

Jump to solution

Please find below the snap which depicts the code with both IF condition and without IF condition.

and right below is my output result.

You can easily find out the difference that the output of IF condition is not displaying properly compared to the output of without IF condition.

Also I am attaching the sample code file which I have made. Sample Doc

Can you share your thoughts on the same.

0 Kudos
Reply
Workflow Hero

Re: IF condition to display a Table in Word document

Jump to solution

Hey Ryan,

I tried with updating the field but still no success. I added a comment with the code snippet an a sample code file. If you can have a look at those and can give your view on the same.

0 Kudos
Reply
Workflow Hero

Re: IF condition to display a Table in Word document

Jump to solution

Pratik, per our email exchange the quotes needed to be added to the tag

"<<Carrier_Generic_Supp_App_QuestionText1>>"

in the IF portion of the formula.

Here is the formula that worked.

Reply