NotLeft not returning expected result

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
Hi,

I'm not sure what I'm missing here. Would appreciate some guidance. 

I have a text field being populated by a WebHook

The resulting text in the field [First Name] 

O: Bill | 

N: Bill

This indicates the WebHook values: [old.First Name] and [new.First Name] 

I created a formula text field to be able to separate these values so that I can format them, or hide them altogether to reduce junk. 

In the calculated field, I have the following:

//should get Bill (removes the O: )

var text old = Trim(NotLeft(Part([First Name],1,"|"),3)); 

//should also get Bill (removes the N: )

var text new = Trim(NotLeft(Part([First Name],2,"|"),3)); 

$old &

$new

What I'm getting instead is:

Bill 

N: Bill

I have tested the result of the "Part" function on its own, and it is correctly returning:

O: Bill and N: Bill respectively. 

Is there something wrong in my formula that's causing this to happen? 

Second part of this. As I was trying to debug this issue. I added the following:

"DEBUG: " & $old & 

"DEBUG: " & $new  

as a result, I invariably got the following instead of what I expected: 

DEBUG: Bill N: BillDEBUG: 

Any thoughts would be greatly appreciated! 
Photo of George

George

  • 30 Points

Posted 2 years ago

  • 0
  • 1
Photo of George

George

  • 30 Points
Well, it turns out adding an additional pipe "|" after the second value made all the difference.  Thanks all the same! :)