0

I am trying to have text in a field print but only if it is after "~" with the following formula:

right({ShipLabel.view_Part_Description},instr(strreverse({ShipLabel.view_Part_Description}),"~")-1)

This is working perfectly when a "~" is present but when there is no "~" within the table field our label completely fails to print. Is there a way to combine this with an if else "0" or something similar?

Thanks in advance!

2 Answers2

0

This expression should do it:

local stringvar array myArray := Split({ShipLabel.view_Part_Description}, "~");
myArray[UBound(myArray)];
MilletSoftware
  • 3,521
  • 2
  • 12
  • 15
  • This works wonderfully at getting text after the symbol to print! The only issue is that it's printing the other non-relevant text in the table field when the symbol is not present. Is there a way to not print anything or print "0" when the symbol isn't there? – Jessica Danielson Jan 30 '20 at 19:00
0

Use this then:

local stringvar array myArray := Split({ShipLabel.view_Part_Description}, "~");
IF UBound(myArray) = 2 Then myArray[2] ELSE "";
MilletSoftware
  • 3,521
  • 2
  • 12
  • 15