AnsweredAssumed Answered

can't get leftwords to work in a boolean comparison

Question asked by tobiasnyc on Jan 15, 2018
Latest reply on Jan 16, 2018 by tobiasnyc

Hi everyone,

 

It's been a very long night trying to get a script fixed...

I have a table with transactions and one with an addressbook. In the latter I have several fields containing default values set to categorize various transactions by means of a script. Whenever a transaction reads, say "Apple Store", in the name field, it matches that to my addressbook and then copies values from the addressbook record to the respective transaction. The purpose is to get the repetitive bulk of data entry done by a script.

 

Because some of the vendors have really long names, I would like to only match the first two words. However, I cannot get that to work. I can only match the full fields. I have tested the LeftWords-function with a separate script, and I believe I have isolated the problem to that step. It simply ignores the number "2" and compares both entire fields.

 

The relationship between the tables is:

Transactions::Name = Addressbook::Name

 

My script looks as follows:

Go to Record/Request/Page [First]

Loop

if [ LeftWords ( Transactions::Name ; 2 ) = LeftWords ( Addressbook::Name ; 2 ) ]

Set Field [ Transactions::Field1; Addressbook::Field1 ]

...

End If

Go to Record/Request/Page [Next; Exit after last]

End Loop

 

Any ideas?

 

Many thanks in advance!

Tobias

Outcomes