chrishigh
Canvas Initiate

Trying and Failing to use nested IF Statement in MS Word

I've done plenty of IF statement formulas in Word, and plenty of NESTED IF statement in Salesforce, but I can't seem to get a nested IF statement to work in Word. I've looked many Google results and the approaches never quite work, I'm assuming I'm down to something as simple as a misplaced quotation mark now.

My use case is to TRANSLATE an English pick value into German for the output document. The users aren't using German, but the customers might be. I've tried a dozen variables of the statement below, but the output keeps resulting as {IF regardless of input. It's treating the very first statement as a false instead of moving to the next nest... Can anyone recommend a fix?

 

IF "<<Quote_to_Contract_Commitment_Level>>" = "Quarterly" "Vierteljährlich" {IF "<<Quote_to_Contract_Commitment_Level>>" = "Monthly" "Monatlich" {IF "<<Quote_to_Contract_Commitment_Level>>" = "Other" "Andere" "Jährlich" } }

Labels: (1)
0 Kudos
Reply
9 Replies
kchaluvadi
Workflow Veteran

Re: Trying and Failing to use nested IF Statement in MS Word

Hi,

Are you missing any delimeter in the syntax? I have updated it with "," please check if it works.

IF "<<Quote_to_Contract_Commitment_Level>>" = "Quarterly" "Vierteljährlich",
  {IF "<<Quote_to_Contract_Commitment_Level>>" = "Monthly" "Monatlich",
    {IF "<<Quote_to_Contract_Commitment_Level>>" = "Other" "Andere" "Jährlich" }
}

0 Kudos
Reply
chrishigh
Canvas Initiate

Re: Trying and Failing to use nested IF Statement in MS Word

That didn't work unfortunately, now it treats the comma as the fallback word. It would have surprised me, of the many examples I've looked at, none utilize comma delimiters in Word. Only spaces.

 

Before and after merge posted below.

Capture 1.JPG

0 Kudos
Reply
Safiya
Forms Fledgling

Re: Trying and Failing to use nested IF Statement in MS Word

Hi @chrishigh 

 

You may try in this format instead of nested

 

{IF "<<Quote_to_Contract_Commitment_Level>>" = "Quarterly" "Vierteljährlich"  ""}

{IF "<<Quote_to_Contract_Commitment_Level>>" = "Monthly" "Monatlich"  ""}

{IF "<<Quote_to_Contract_Commitment_Level>>" = "Other" "Andere" "Jährlich" } 

 

Regards

S.Aj

0 Kudos
Reply
leighburke
Nintex Employee
Nintex Employee

Re: Trying and Failing to use nested IF Statement in MS Word

@chrishigh When nesting it usually is in the false condition and should like this format. A third nest would replace the last tag location.

{IF "<<tag>>" = "Retainer" "True" "{IF "<<tag>>" = "Sample" "" "<<tag>>"}"}

0 Kudos
Reply
chrishigh
Canvas Initiate

Re: Trying and Failing to use nested IF Statement in MS Word

I tried that format before, unfortunately it's one of the versions that just puts {IF into the document. It's treating the quote mark before the bracket and the one before the tag as the container of a text phrase instead of obeying the rest of the formula. Here's exactly what I used:

{IF "<<Quote_to_Contract_Commitment_Level>>" = "Quarterly" "Vierteljährlich" "{IF "<<Quote_to_Contract_Commitment_Level>>" = "Monthly" "Monatlich" "{IF "<<Quote_to_Contract_Commitment_Level>>" = "Other" "Andere" "Jährlich"}"}"}
0 Kudos
Reply
leighburke
Nintex Employee
Nintex Employee

Re: Trying and Failing to use nested IF Statement in MS Word

@chrishigh  That's odd that usually works for me, are you inserting the new conditional text inside rather than copy pasting?

0 Kudos
Reply
chrishigh
Canvas Initiate

Re: Trying and Failing to use nested IF Statement in MS Word

Not sure what you mean, what I've pasted above is exactly as it appears in the Formula builder of Word (except for the very first and vary last brackets which self-populate when the formula is saved and field visibility is toggled, I included them for illustrative purpose).

 

@Safiya your method is cheating LOL. 😆 But, it does work as long as I use FOUR unique statements instead of three. By including the false statement in your last formula, you cause Jährlich to appear under every circumstance, including combined with the other two values when summoned. Here's the working set:

 

Capture 2.JPG

 

There is one unseen benefit to using this method - Word is rather restrictive about the length of formulas you can build, and this does get around that.

0 Kudos
Reply
leighburke
Nintex Employee
Nintex Employee

Re: Trying and Failing to use nested IF Statement in MS Word

@chrishigh I usually do my formulas using ctrl+f9 to insert the new conditional text rather than the formula builder, that's what I meant by inserting.

0 Kudos
Reply
chrishigh
Canvas Initiate

Re: Trying and Failing to use nested IF Statement in MS Word

Ah, since Word is so finicky and with so little space in the formula builder to word, I usually insert the Field (from quick parts) and paste in a complete formula (with no line breaks) that I've assembled in Text or Notepad++
0 Kudos
Reply