View Single Post
 
Old 10-30-2019, 02:46 PM
Ronstr Ronstr is offline Windows 7 64bit Office 2016
Novice
 
Join Date: Oct 2019
Posts: 1
Ronstr is on a distinguished road
Default Merging one of two fields, but they could be blank

I'm trying to use mergefield to create a label for our boxes.
On the label we have a spot for our customer's PO number (Purchase Order). One issue is that we do work for brokers and they want their customer's PO on the label. The last thing is sometimes we don't get a PO number at all.
We want to show the SubCustomerPO, but if it's blank we would then show the CustomerPO. We would not show both SubcustomerPO and CustomerPO. If they are both blank, we don't want to show anything.
I can get either to show, but if they are both blank, I still get a blank line on the label.

Someone gave me this, but it shows "PO: " if both fields are blank:

{ if{ MERGEFIELD "SubCustomerJob"}="" "PO#:" "{ MERGEFIELD"SubCustomerJob" } "} { if{MERGEFIELD "SubCustomerPOJob" }="" "{MERGEFIELD CustomerPO }" "{MERGEFIELD "SubCustomerPOJob" }" }

I also tried this, but it shows a blank line if both fields are blank:

{ if { MERGEFIELD "SubCustomerPOJob" } = "" { SET LabelPO{ MERGEFIELD "CustomerPO" }}{ SET LabelPO {MERGEFIELD "SubCustomerPOJob" }}}{ if { REF LabelPO } = "" "" "PO: " }{ REF LabelPO }

I'm sure I've overlooked what I'm supposed to do in everything I've read, but I haven't been able to find it.
Any help is appreciated.
Thanks
Ron
Reply With Quote