<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: External library sheetjs wont load in Splunk javascript in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Why-won-t-External-library-sheetjs-load-in-Splunk-javascript/m-p/580788#M10281</link>
    <description>&lt;P&gt;After several hours of trial and error we managed to get sheetjs to work in a dashboard script with requirejs.&lt;BR /&gt;&lt;BR /&gt;The solution was to set the require.config settings like follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;require.config({
    paths: {
        'xlsx': '/static/app/my_app/sheetjs/dist/xlsx.full.min'
    }
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;And then load it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;require([
    "splunkjs/mvc",
    "splunkjs/mvc/searchmanager",
    "xlsx",
    "splunkjs/mvc/simplexml/ready!"
    ], function(
            mvc,
            SearchManager)
    {
        console.log(XLSX.version);  
    }
);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am new to requirejs and javascript in general, but this way it worked. If anyone cares to explain why, we thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jan 2022 14:10:31 GMT</pubDate>
    <dc:creator>fralcalde</dc:creator>
    <dc:date>2022-01-12T14:10:31Z</dc:date>
    <item>
      <title>Why won't External library sheetjs load in Splunk javascript?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-won-t-External-library-sheetjs-load-in-Splunk-javascript/m-p/580518#M10280</link>
      <description>&lt;P&gt;Hi, we're trying to import sheetjs into a custom SplunkJS script so we can export some results into xlsx.&lt;BR /&gt;Tried to add it in the required section at the begining of the script but is not working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;require([
    "splunkjs/mvc",
    "&amp;lt;path to xlsx.full.min.js&amp;gt;",
    "splunkjs/mvc/searchmanager",
    "splunkjs/mvc/simplexml/ready!"
    ], function(
        mvc,
        XLSX,
        SearchManager)
    {
        console.log(XLSX.version);
    }
);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Here is the sheetjs documentation: &lt;A href="https://github.com/SheetJS/sheetjs" target="_blank" rel="noopener"&gt;https://github.com/SheetJS/sheetjs&lt;/A&gt;&lt;BR /&gt;Any help ll be appreciated.&lt;BR /&gt;&lt;BR /&gt;Regards.&lt;BR /&gt;&lt;BR /&gt;Javier.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 02:53:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-won-t-External-library-sheetjs-load-in-Splunk-javascript/m-p/580518#M10280</guid>
      <dc:creator>joshiro</dc:creator>
      <dc:date>2022-07-07T02:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: External library sheetjs wont load in Splunk javascript</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-won-t-External-library-sheetjs-load-in-Splunk-javascript/m-p/580788#M10281</link>
      <description>&lt;P&gt;After several hours of trial and error we managed to get sheetjs to work in a dashboard script with requirejs.&lt;BR /&gt;&lt;BR /&gt;The solution was to set the require.config settings like follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;require.config({
    paths: {
        'xlsx': '/static/app/my_app/sheetjs/dist/xlsx.full.min'
    }
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;And then load it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;require([
    "splunkjs/mvc",
    "splunkjs/mvc/searchmanager",
    "xlsx",
    "splunkjs/mvc/simplexml/ready!"
    ], function(
            mvc,
            SearchManager)
    {
        console.log(XLSX.version);  
    }
);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am new to requirejs and javascript in general, but this way it worked. If anyone cares to explain why, we thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 14:10:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-won-t-External-library-sheetjs-load-in-Splunk-javascript/m-p/580788#M10281</guid>
      <dc:creator>fralcalde</dc:creator>
      <dc:date>2022-01-12T14:10:31Z</dc:date>
    </item>
  </channel>
</rss>

