If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
If then Else mail merge field
HI
Is there a way to evaluate 3 condition with the if then else field option. I would like Field 4 to look at fields 1-3 and give me the value of the field the has a Yes. In the example below the vlaue of Field3 would be populated in Field 4 Field1 No Field2 No Field3 Yes Thanks for any help |
#2
|
|||
|
|||
If then Else mail merge field
Your requirement is a bit ambiguous because if you want the value of the
field that has value "Yes", the value is always going to be "yes". If ou actually want to put the /name/ of the field whose value is "Yes" into a variable you can work with, then you could use something like { IF "{ MERGEFIELD Field1 }" = "Yes" "{ SET myField4 "Field1" }" "" }{ IF "{ MERGEFIELD Field2 }" = "Yes" "{ SET myField4 "Field2" }" "" }{ IF "{ MERGEFIELD Field3 }" = "Yes" "{ SET myField4 "Field3" }" "" } If more than one of Field1, Field2, Field3 has the value "Yes" then the above code would set myField4 to the field with the highest number (e.g. if all are "Yes", myField4 would be set to "Field3" You could reference myField4 using { REF myField4 } This assumes that a. your Field1,Field2, Field3 are merge fields b. the "Yes" value is always precisely "Yes" - if it could be "YES" etc. then you would be better off with { IF "{ MERGEFIELD Field1 \*Upper }" = "YES" "{ SET myField4 "Field1" }" "" } or some such But that result does not look particularly useful to me either - maybe you want to set myfield4 to some other value depending on which of Field1, Field2, Field3 is "yes" ? If so, perhaps you can spell it out. Peter Jamieson http://tips.pjmsn.me.uk ram wrote: HI Is there a way to evaluate 3 condition with the if then else field option. I would like Field 4 to look at fields 1-3 and give me the value of the field the has a Yes. In the example below the vlaue of Field3 would be populated in Field 4 Field1 No Field2 No Field3 Yes Thanks for any help |
#3
|
|||
|
|||
If then Else mail merge field
Thank You this was very helpful
"Peter Jamieson" wrote: Your requirement is a bit ambiguous because if you want the value of the field that has value "Yes", the value is always going to be "yes". If ou actually want to put the /name/ of the field whose value is "Yes" into a variable you can work with, then you could use something like { IF "{ MERGEFIELD Field1 }" = "Yes" "{ SET myField4 "Field1" }" "" }{ IF "{ MERGEFIELD Field2 }" = "Yes" "{ SET myField4 "Field2" }" "" }{ IF "{ MERGEFIELD Field3 }" = "Yes" "{ SET myField4 "Field3" }" "" } If more than one of Field1, Field2, Field3 has the value "Yes" then the above code would set myField4 to the field with the highest number (e.g. if all are "Yes", myField4 would be set to "Field3" You could reference myField4 using { REF myField4 } This assumes that a. your Field1,Field2, Field3 are merge fields b. the "Yes" value is always precisely "Yes" - if it could be "YES" etc. then you would be better off with { IF "{ MERGEFIELD Field1 \*Upper }" = "YES" "{ SET myField4 "Field1" }" "" } or some such But that result does not look particularly useful to me either - maybe you want to set myfield4 to some other value depending on which of Field1, Field2, Field3 is "yes" ? If so, perhaps you can spell it out. Peter Jamieson http://tips.pjmsn.me.uk ram wrote: HI Is there a way to evaluate 3 condition with the if then else field option. I would like Field 4 to look at fields 1-3 and give me the value of the field the has a Yes. In the example below the vlaue of Field3 would be populated in Field 4 Field1 No Field2 No Field3 Yes Thanks for any help |
Thread Tools | |
Display Modes | |
|
|