#1
|
|||
|
|||
Conditional field doesn't evaluate as expected
I have a conditional field that looks like this:
{ If {Mergefield PaySource } = “1201710P” “Your extra gift” “Your gift” } When I update the internal field I am looking at this: { If 1201710 = “1201710P” “Your extra gift” “Your gift” } When I update the conditional field I get “Your extra gift”. So it appears that Word is treating 1201710 and 1201710P as equal in value. The PaySource can have about 6 different values. One will be 1201710. The others will all be that number with a letter suffix added. Any advice on what I am doing wrong and how to revise the field will be much appreciated. |
#2
|
||||
|
||||
If you want to test for the P, you could simply use:
Your {IF{MERGEFIELD PaySource }= "*P" "extra "}gift
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Thanks Paul for your prompt reply. Thanks also for your suggestion which seems to have done the trick for me. But although I see how yours works, I don't see why my version doesn't. Are you able to explain why Word is evaluating the two conditions differently?
|
#4
|
||||
|
||||
Basically, the issue is that the evaluation with the number prefix on both sides treats the mergefield and comparison string as numeric.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
OK. I don't really understand why it would do that, because it effectively means Word is not comparing the actual values involved. But then, who am I to debate the subject!
More importantly, I've learned something new and you've answered my question. Much appreciated. So can you finish by pointing me to the "Solved" button for this thread? |
#6
|
||||
|
||||
It's accessed via the 'Thread Tools' dropdown. Done.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
conditional, merge fields |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Conditional Field | CKTisdale | Word | 1 | 04-10-2015 02:41 PM |
Conditional format a button based off a value in a field | Triscia | Misc | 0 | 03-11-2015 11:12 AM |
Conditional formatting in custom field | Puddlerunna | Project | 6 | 11-05-2014 06:14 AM |
Calculated field in PivotTable not doing as expected | marketshare | Excel | 2 | 10-17-2013 02:05 AM |
Word Doesn't Convert Non-Unicode Characters As Expected | fitchkd25 | Word | 1 | 08-17-2012 12:24 AM |