Hi All
Quick question.
For a particular database I need to assign a separate field with a number based off data from a existing field.
For a another database i used the following and it seemed to work
data.extract(‘./CUSTOMER[1]/Country[1]’);
var myData = data.extract(‘./CUSTOMER[1]/Country[1]’,0);
if (myData==‘CA’)
‘1’;
else {
if (myData == ‘US’)
‘2’;
else
‘’;
}
I got the data location from the datamapper where it had a field XPath:
Now for a CSV file it doesnt seem to have a XPath:
Mode: Location
Column: (field name)
As a example, lets say the column I need to use is called State
Mode: Location
Column: State
top offset: 0
I created a new column called insert to use this
How would i change the previous script to reference this column?
Would the mode still Location then type in Post function:
Or would it be same as previous javascript.
EDIT
It seems Just typing the column name seem to have worked, but realised the issue was more for the actual script.
I presumed if there is more then 2 variables, for example VIC gets 1, NSW gets 2, QLD gets 3 then the if and else doesnt seem to work?
Not well versed in javascript
Many Thanks
Best Regards
Jason