Check if one of two values exist, then truncate the field.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Check if one of two values exist, then truncate the field.

davidbullship
This post has NOT been accepted by the mailing list yet.
This post was updated on .
I am absolutely stumped here fellas. I've written my logic out many times and stared at the functions for hours, but I haven't had any luck on how to fix this. Can anyone help me out on how this should look?

1. Check for %catalognumber%. If true, go to line 2. If false go to line 4.
2. Check if %catalognumber% is greater than 15 characters long. If true, go to line 3.
3. Output %catalognumber% truncated to 15 characters and an …. !END!
4. Check for %label%. If true, go to line 5. If false, !END!
5. Check if %label% is greater than 15 characters long. If true, go to line 6.
6. Output %label% truncated to 15 characters and an …. !END!

EDIT: I figured it out.

$if($lt(%label%,%catalognumber%),$if($gt($len(%catalognumber%),15), [$truncate(%catalognumber%,15)…], [%catalognumber%]),$if(%label%,$if($gt($len(%label%),15), [$truncate(%label%,15)…], [%label%]),))