You are viewing limited content. For full access, please sign in.

Question

Question

Merge FIeld IF Statement

asked on January 7, 2019

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?

0 0

Answer

SELECTED ANSWER
replied on January 8, 2019

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).

0 0

Replies

replied on January 7, 2019

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.

0 0
replied on January 7, 2019 Show version history

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?

0 0
replied on January 8, 2019

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.

0 0
replied on January 8, 2019

Yikes. We tried it before, and were told it wasn't supported. Now I get to go find the person who told us that. devil

0 0
replied on January 8, 2019

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.

0 0
SELECTED ANSWER
replied on January 8, 2019

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).

0 0
replied on January 17, 2019

Thanks for all the help!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.