I'm trying to get update word activity to check an IF statement in my word doc. Essentially, I want to insert a mr/mrs/etc if there is one and not insert it if there isn't without leaving a space. The statement I had in the word doc was { MAILMERGE pcor_pt_sal }{IF {MAILMERGE pcor_pt_sal = "" "" '' ''} I got the syntax from this site https://wordmvp.com/FAQs/MailMerge/MMergeIfFields.htm but when I ran it it left the IF and "" portion of it. It did replace the MAILMERGE part with the entry. Is this not supported or am I just doing it wrong?
Question
Question
Answer
The syntax says "if the pcor_pt_mid field is blank, insert nothing; otherwise add a space".
You have a space before the pcor_pt_mid merge field and one after the IF statement before the pcor_pt_nm1 merge field.
So if pcor_pt_mid is not there, you always have 2 spaces between pcor_pt_nm2 and pcor_pt_nm1. If pcor_pt_mid is there, you will have 2 spaces between pcor_pt_mid and pcor_pr_nm1 (the one between fields and the one added by the IF statement).
Replies
This is not supported. Using those features requires that the document be opened in Word. When Workflow updates a document, it doesn't run any of the logic associated with a field. You could achieve the same result by moving your logic into the workflow itself.
That's what I imagined. Thanks for the response !
EDIT: So the white paper "Updating a Microsoft Word Document with Laserfiche Workflow" says that workflow accepts the formulas. Is that just wrong?
Field formatting is supported.
The snippet you pasted above does not have the closing brace on the merge field definition in the IF statement, so that's probably what's causing it.
Yikes. We tried it before, and were told it wasn't supported. Now I get to go find the person who told us that.
I'm not sure what I'm doing wrong here. The syntax looks good to me...
It still has a blank if the field is empty.
The syntax says "if the pcor_pt_mid field is blank, insert nothing; otherwise add a space".
You have a space before the pcor_pt_mid merge field and one after the IF statement before the pcor_pt_nm1 merge field.
So if pcor_pt_mid is not there, you always have 2 spaces between pcor_pt_nm2 and pcor_pt_nm1. If pcor_pt_mid is there, you will have 2 spaces between pcor_pt_mid and pcor_pr_nm1 (the one between fields and the one added by the IF statement).
Thanks for all the help!