Solved

Conditionally controlling Tables to be included in output

  • 13 April 2016
  • 3 replies
  • 199 views

Badge +1

Based on the DrawLOOP docs and this question I've managed to get some simple conditional formatting applied to my output document (Word doc). 

 

I'd like to go another step.  Is it possible to create dynamic tables based on conditionals?  For instance I have two Project types: A and B.  Can I use DrawLOOP to pull info from certain fields and display it one type of table if current project is type A but create a different looking table (with different content pulled from SFDC) if project is of type B? 

 

I'm fairly new to DrawLOOP but the way I understand the condition formatting applied in the link above, this process is happening in Word.  To continue this way would require creating both tables in the output doc and rely on Word to display one or the other.  Can an entire table be wrapped in this kind of conditional?  Seems to me this should be handled at the document creation step- only create the table of interest based on info from SalesForce.

 

So two questions, do I understand the process correctly, and is the a way to handle conditionally including tables constructed from SFDC data?

 

Any input would be appreciated.  Thanks

icon

Best answer by tommy_mckinzie 15 April 2016, 04:08

View original

3 replies

Badge +4

You are correct. It is definitely possible to utilize tables in Word that come in conditionally.

We recommend building out the 2 tables that you want to utilize first. Once you have done this, you can cut and paste the tables and put them in the conditional statement in your Word template.

e.g. IF "<<Project_Type>>" = "A" "Table A" "Table B"

Badge +1

Hi Tommy-

Thanks for responding.  I'm embarrassed to admit I didn't actually try that with a table before posting the question. I just didn't expect the conditional logic in word to accept anything 'complex'.  I tried a basic version and it works!  Thanks.  I'll work on building the table I actually need in the output.  Much appreciated.

Badge +1

Hi Frank, it seems to be working just fine.  I've selected Tommy's answer and marked this question as Answered.  Thanks.

Reply