Hello. As you can see in the images I am trying to send two text variables to the Java script, but this gives me an error. how can I solve that. what am I doing wrong?.The OLM is Attachments.
Hello @Erick Narvaez
The issue with the JS is that you are passing the data as a string to the "addPaths" while it's expecting an array.
Here's how to fix it:
1. Add an additional [] to the data you have in the default value of MatrizNodosPlano:
"[ ['Siebel', 'BUS', 'Registro Trafico[REG-TRF]'],
['SAP R3', 'BUS'],
['APIM', 'BUS'],
['BUS', 'OIC'] ]"
2. Modify your JS as follows:
var paths = $parameters.MatrizNodosPlano.replace(/'/g, '"');
paths = JSON.parse(paths);
var c = new flowjs.DiGraph();
c.addPaths(paths);
3. Use the "eval()" function to execute a string as a code snippet:
eval($parameters.ConfigNodos);
The remaining part of the code can remain the same. I will attach it as an OML.
I hope this helps!
Best regards,
Abed
Great I learned something new today. eval()
That's what the forum is for, cheers :)
@Abed Al Banna
Thank you very much.. it was very useful. God bless you
Hi @Erick Narvaez,
Is there only these 3 types or more to come?
If it is only these 3 items, then you can pass the Link and color as input Instead of this whole code.