Dev Space

Customize and extend the power of Alteryx with SDKs, APIs, custom tools, and more.
SOLVED

JavaScript plugin error when loading plugin

chrisha
11 - Bolide

Based on the Python SDK examples I've tried to create a new plugin. I created a folder named "SKOPOSPythonTest" in C:\Users\<Username>\AppData\Roaming\Alteryx\Tools\ with the following files:

  • SKOPOSPythonTestConfig.xml
  • SKOPOSPythonTestEngine.py
  • SKOPOSPythonTestGui.html
  • SKOPOSPythonTestIcon.png

Everything is basically copy-pasted from the "Single Input Output" Example (https://github.com/alteryx/python-sdk-samples/tree/master/Python%20-%20Single%20Input%20Output).

 

Whenever I start Alteryx Designer, I receive an error message "JavaScript plugin error: The root element is missing" (roughly translated). I have double-checked the HTML interface, Python module and Config XML but cannot find any missing nodes or elements. The config XML contains the following:

 

<?xml version="1.0"?>
<AlteryxJavaScriptPlugin>

  <EngineSettings EngineDll="Python" EngineDllEntryPoint="SKOPOSPythonTestEngine.py" SdkVersion="10.1" />

  <GuiSettings Html="SKOPOSPythonTestGui.html" Icon="SKOPOSPythonTestIcon.png" SdkVersion="10.1">
    <InputConnections>
      <Connection Name="Input" AllowMultiple="False" Optional="False" Type="Connection" Label="" />
    </InputConnections>
    <OutputConnections>
      <Connection Name="Output" AllowMultiple="False" Optional="False" Type="Connection" Label="" />
    </OutputConnections>
  </GuiSettings>

  <Properties>
    <MetaInfo>
      <Name>SKOPOS Test Tool - Python SDK</Name>
      <Description>Does not do anything at all.</Description>
      <ToolVersion>1.0</ToolVersion>
      <CategoryName>SKOPOS Analytics</CategoryName>
      <SearchTags>python, sdk, skopos</SearchTags>
      <Author>Christopher Harms</Author>
      <Company>SKOPOS GmbH & Co KG</Company>
      <Copyright>2018</Copyright>
    </MetaInfo>
  </Properties>

</AlteryxJavaScriptPlugin>

Any suggestion where I should start looking? The error message itself is not really helpful here...

2 REPLIES 2
MikeSp
Alteryx
Alteryx

Hi @chrisha,

 

Just a quick disclaimer that I personally have not done much development with the SDK myself, however, I have done a bit of tinkering with XML in the past and noticed this on a quick scan.

 

I believe line 23 may be the issue (<Company> tag). The "&" symbol is typically used as an escape character in XML, so I believe the XML parser may be having trouble reading the rest of the file. More here on how to handle those characters:

 

https://www.w3schools.com/xml/xml_syntax.asp

Mike Spoula
Senior Solutions Architect
Alteryx
chrisha
11 - Bolide

Oh... yes, you are absolutely right. Escaping it to &amp; worked...

 

Thank you!