cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Error org.mozilla.javascript.UniqueTag@3a405ae8: NOT_FOUND when tring to assign to result

oskarberntorp
13-Aquamarine

Error org.mozilla.javascript.UniqueTag@3a405ae8: NOT_FOUND when tring to assign to result

Hi,

I have a service, returning a string, where I send in a comma separated list of values and if I inside a forEach loop try to access a value and assign it as a result I get the error "org.mozilla.javascript.UniqueTag@3a405ae8: NOT_FOUND"

 

Bellow is a code snipped that is addreviated.

 

 

csvInput.trim().split(",").forEach(csv=> {
            var result = csv; // This gives the error

 

 

 I see no reason why it happens, can anyone suggest a fix and explain this error message?

Kindly
Oskar

ACCEPTED SOLUTION

Accepted Solutions

Hello Oskar,

 

That  “org.mozilla.javascript.UniqueTag@3a405ae8: NOT_FOUND” is a ThingWorx way of saying that your service returned a JavaScript undefined.


I can’t test it right now, but what likely happens here is that var result gets scoped to the lambda function, and is not visible in the outer scope. Logically you should not be able to redefine a variable in a loop. Try to move it out of the loop:

 
var result = "";

…forEach(csv => { result = csv; });

 

(sorry, can’t format it on the phone)

 

Also, consider using CSV extension for parsing CSV files.

 

/ Constantine

View solution in original post

1 REPLY 1

Hello Oskar,

 

That  “org.mozilla.javascript.UniqueTag@3a405ae8: NOT_FOUND” is a ThingWorx way of saying that your service returned a JavaScript undefined.


I can’t test it right now, but what likely happens here is that var result gets scoped to the lambda function, and is not visible in the outer scope. Logically you should not be able to redefine a variable in a loop. Try to move it out of the loop:

 
var result = "";

…forEach(csv => { result = csv; });

 

(sorry, can’t format it on the phone)

 

Also, consider using CSV extension for parsing CSV files.

 

/ Constantine

Announcements


Top Tags