Skip to main content
Nintex Community Menu Bar

Trying and Failing to use nested IF Statement in MS Word

  • June 24, 2021
  • 9 replies
  • 1016 views

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" } }

9 replies

Forum|alt.badge.img+12
  • Apprentice
  • June 24, 2021

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" }
}


  • Author
  • Rookie
  • June 24, 2021

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.


  • June 24, 2021

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


Forum|alt.badge.img+14
  • Nintex Employee
  • June 24, 2021

@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>>"}"}


  • Author
  • Rookie
  • June 24, 2021
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"}"}"}

Forum|alt.badge.img+14
  • Nintex Employee
  • June 24, 2021

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


  • Author
  • Rookie
  • June 24, 2021

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:

 

 

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.


Forum|alt.badge.img+14
  • Nintex Employee
  • June 24, 2021

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


  • Author
  • Rookie
  • June 24, 2021
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++