<?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: Multifile Import in a script / workflow in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Multifile-Import-in-a-script-workflow/m-p/867979#M103082</link>
    <description>&lt;P&gt;You should be able to get the list of imported tables from the callback function, look at the SetImportCallback example. &lt;/P&gt;
&lt;P&gt;If JSL does the &amp;lt;&amp;lt;ImportData, that also returns a list of tables. But in your case, the user presses a button and the callback is the only way to report them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 12 Apr 2025 21:17:58 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2025-04-12T21:17:58Z</dc:date>
    <item>
      <title>Multifile Import in a script / workflow</title>
      <link>https://community.jmp.com/t5/Discussions/Multifile-Import-in-a-script-workflow/m-p/867950#M103081</link>
      <description>&lt;P&gt;What is the best way to use &lt;FONT face="courier new,courier"&gt;Multi File Import&lt;/FONT&gt; in a script?&lt;/P&gt;
&lt;P&gt;[I want to give the user the chance to edit the settings and then click on &lt;FONT face="courier new,courier"&gt;Import&lt;/FONT&gt;.]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My current approach:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Pause the script till the import is ready:&lt;BR /&gt;&lt;EM&gt;- use a while loop&lt;BR /&gt;- stop it via &lt;/EM&gt;&lt;FONT face="courier new,courier"&gt;Set Import Callback&lt;/FONT&gt;&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;finished= 0;
mfi = Multiple File Import(
	&amp;lt;&amp;lt;Set Import Callback( finished=1)
);

my win = mfi &amp;lt;&amp;lt; createwindow;
while(not(finished), wait(1));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;LI&gt;get a list of the imported data tables:&lt;BR /&gt;via &lt;FONT face="courier new,courier"&gt;_wfb_Listdiff()&lt;/FONT&gt; (from Workflow Builder):&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;_wfb_ListDiff = Function( {tempOld, tempNew},
	For( i = 1, i &amp;lt;= N Items( tempOld ), i++,
		For( k = N Items( tempNew ), k &amp;gt;= 1, k--,
			If( tempOld[i] == tempNew[k],
				Remove From( tempNew, k, 1 )
			)
		)
	);
	tempNew;
);
Custom_step_tables_old = Get Data Table List();
MFI();
while(no(finished), wait());
Custom_step_tables_new = Get Data Table List();
dts = _wfb_ListDiff( Custom_step_tables_old, Custom_step_tables_new );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;if there is no data ..&lt;BR /&gt;
&lt;P&gt;To stop the execution of subsequent code, check&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;if (items(dts) ==0, Throw("no data"));&lt;/CODE&gt;&lt;/PRE&gt;
did you know that &lt;FONT face="courier new,courier"&gt;stop()&lt;/FONT&gt; inside a Workflow step just stops the execution of the current step?&lt;BR /&gt;so: &lt;FONT face="courier new,courier"&gt;Throw().&lt;/FONT&gt;&amp;nbsp;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1744469787929.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/74788i1DF812C5AC386C3A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1744469787929.png" alt="hogi_0-1744469787929.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;The user can close the MFI dialog via&amp;nbsp;&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1744468837328.png" style="width: 198px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/74787i3E23C1B355C7C9A3/image-dimensions/198x90?v=v2" width="198" height="90" role="button" title="hogi_0-1744468837328.png" alt="hogi_0-1744468837328.png" /&gt;&lt;/span&gt;&lt;BR /&gt;then the while loop will run forever (or: till the user presses ESC)&lt;BR /&gt;-&amp;gt; add an on close script:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;my win = mfi &amp;lt;&amp;lt; createwindow;
wait(0);
current window() &amp;lt;&amp;lt; on close(finished=1)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Sun, 13 Apr 2025 06:02:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multifile-Import-in-a-script-workflow/m-p/867950#M103081</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-04-13T06:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Multifile Import in a script / workflow</title>
      <link>https://community.jmp.com/t5/Discussions/Multifile-Import-in-a-script-workflow/m-p/867979#M103082</link>
      <description>&lt;P&gt;You should be able to get the list of imported tables from the callback function, look at the SetImportCallback example. &lt;/P&gt;
&lt;P&gt;If JSL does the &amp;lt;&amp;lt;ImportData, that also returns a list of tables. But in your case, the user presses a button and the callback is the only way to report them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Apr 2025 21:17:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multifile-Import-in-a-script-workflow/m-p/867979#M103082</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2025-04-12T21:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: Multifile Import in a script / workflow</title>
      <link>https://community.jmp.com/t5/Discussions/Multifile-Import-in-a-script-workflow/m-p/867989#M103086</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As an alternative, I changed the behavior of the Import button:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;my win[ButtonBox(8)] &amp;lt;&amp;lt; set function (dts = mfi &amp;lt;&amp;lt; Import Data(); wait(0); finished=1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But, unfortunately, the original import is triggered as well.&lt;BR /&gt;&lt;BR /&gt;... so I replaced the import button with an alternative one:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;my win = mfi &amp;lt;&amp;lt; createwindow;
my win[ButtonBox(8)]  &amp;lt;&amp;lt; sib append (Button Box ("Import +",dts = mfi &amp;lt;&amp;lt; Import Data(); wait(0); my win &amp;lt;&amp;lt; close window()));&lt;BR /&gt;my win[ButtonBox(8)]&amp;nbsp;&amp;lt;&amp;lt;&amp;nbsp;delete&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What example are you referring to, I couldn't find it.&lt;/P&gt;</description>
      <pubDate>Sat, 26 Apr 2025 18:11:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multifile-Import-in-a-script-workflow/m-p/867989#M103086</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-04-26T18:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: Multifile Import in a script / workflow</title>
      <link>https://community.jmp.com/t5/Discussions/Multifile-Import-in-a-script-workflow/m-p/868017#M103088</link>
      <description>&lt;P&gt;Make sure the category selector shows objects (or all.)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Craige_Hales_0-1744545152791.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/74811iD1DB3240851E9487/image-size/large?v=v2&amp;amp;px=999" role="button" title="Craige_Hales_0-1744545152791.png" alt="Craige_Hales_0-1744545152791.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Apr 2025 11:55:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multifile-Import-in-a-script-workflow/m-p/868017#M103088</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2025-04-13T11:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: Multifile Import in a script / workflow</title>
      <link>https://community.jmp.com/t5/Discussions/Multifile-Import-in-a-script-workflow/m-p/868028#M103090</link>
      <description>&lt;P&gt;: )&lt;/P&gt;</description>
      <pubDate>Sun, 13 Apr 2025 12:42:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multifile-Import-in-a-script-workflow/m-p/868028#M103090</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-04-13T12:42:36Z</dc:date>
    </item>
  </channel>
</rss>

