<?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: Workflow builder error for Custom Action (Error: Send Expects Scriptable Object) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Workflow-builder-error-for-Custom-Action-Error-Send-Expects/m-p/641591#M83866</link>
    <description>&lt;P&gt;You could ask &lt;STRONG&gt;Get Column Names&lt;/STRONG&gt; with the Option "String".&lt;BR /&gt;Then you don't need to ask again for the column name:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
searchWords = "%, ";
columnName = dt &amp;lt;&amp;lt; Get Column Names("String");
N = N Items( columnName );

For(j=1, j&amp;lt;= N, j++,
	x = contains(columnName[j], searchWords);
	If(x  &amp;gt; 0,
		name = Substr(columnName[j], x+3);
		Column(columnName[j]) &amp;lt;&amp;lt; Set Name(Left(name, Length(name)-1));
	);
);&lt;/CODE&gt;&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;</description>
    <pubDate>Mon, 12 Jun 2023 22:25:31 GMT</pubDate>
    <dc:creator>hogi</dc:creator>
    <dc:date>2023-06-12T22:25:31Z</dc:date>
    <item>
      <title>Workflow builder error for Custom Action (Error: Send Expects Scriptable Object)</title>
      <link>https://community.jmp.com/t5/Discussions/Workflow-builder-error-for-Custom-Action-Error-Send-Expects/m-p/641500#M83862</link>
      <description>&lt;P&gt;I added the JSL below as Custom Action in the Workflow builder.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error happened at the For loop (Error: Send Expects Scriptable Object).&lt;/P&gt;&lt;P&gt;While running this script in Script window, it works properly to rename columns header that contain "%, ".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea on how to solve this to make the workflow more smooth? else, need to stop at this step to run Column Renaming script outside the WorkFlow Builder.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
searchWords = "%, ";
columnName = dt &amp;lt;&amp;lt; Get Column Names;
N = N Items( columnName );

For(j=1, j&amp;lt;= N, j++,
	x = contains(columnName[j], searchWords);
	name = Substr(columnName[j] &amp;lt;&amp;lt; Get Name(), x+3);
	If(x  &amp;gt; 0,
		columnName[j] &amp;lt;&amp;lt; Set Name(Left(name, Length(name)-1));
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Jun 2023 17:43:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Workflow-builder-error-for-Custom-Action-Error-Send-Expects/m-p/641500#M83862</guid>
      <dc:creator>Nita_Natchanok</dc:creator>
      <dc:date>2023-06-12T17:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow builder error for Custom Action (Error: Send Expects Scriptable Object)</title>
      <link>https://community.jmp.com/t5/Discussions/Workflow-builder-error-for-Custom-Action-Error-Send-Expects/m-p/641591#M83866</link>
      <description>&lt;P&gt;You could ask &lt;STRONG&gt;Get Column Names&lt;/STRONG&gt; with the Option "String".&lt;BR /&gt;Then you don't need to ask again for the column name:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
searchWords = "%, ";
columnName = dt &amp;lt;&amp;lt; Get Column Names("String");
N = N Items( columnName );

For(j=1, j&amp;lt;= N, j++,
	x = contains(columnName[j], searchWords);
	If(x  &amp;gt; 0,
		name = Substr(columnName[j], x+3);
		Column(columnName[j]) &amp;lt;&amp;lt; Set Name(Left(name, Length(name)-1));
	);
);&lt;/CODE&gt;&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Jun 2023 22:25:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Workflow-builder-error-for-Custom-Action-Error-Send-Expects/m-p/641591#M83866</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-06-12T22:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow builder error for Custom Action (Error: Send Expects Scriptable Object)</title>
      <link>https://community.jmp.com/t5/Discussions/Workflow-builder-error-for-Custom-Action-Error-Send-Expects/m-p/641656#M83873</link>
      <description>&lt;P&gt;&lt;STRONG&gt;PS:&lt;/STRONG&gt; don't use variable names from this list:&lt;BR /&gt;{&lt;EM&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;&lt;/EM&gt;,&amp;nbsp;age,&amp;nbsp;sex,&amp;nbsp;height,&amp;nbsp;weight}&lt;/P&gt;&lt;P&gt;:)&lt;/img&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 08:21:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Workflow-builder-error-for-Custom-Action-Error-Send-Expects/m-p/641656#M83873</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-06-13T08:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow builder error for Custom Action (Error: Send Expects Scriptable Object)</title>
      <link>https://community.jmp.com/t5/Discussions/Workflow-builder-error-for-Custom-Action-Error-Send-Expects/m-p/641659#M83874</link>
      <description>&lt;P&gt;Add-on (slightly related) question:&lt;BR /&gt;&lt;BR /&gt;Why does calling a list entry &lt;EM&gt;&lt;STRONG&gt;alter&lt;/STRONG&gt; &lt;/EM&gt;the list entry?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Running the first part of&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
searchWords = "%, ";
:sex &amp;lt;&amp;lt; set name ("test%, SEX#");
columnName = dt &amp;lt;&amp;lt; Get Column Names;
show(columnName);
columnName[1] &amp;lt;&amp;lt; Get Name();
columnName[2] &amp;lt;&amp;lt; Get Name();
columnName[3] &amp;lt;&amp;lt; Get Name();
columnName[4] &amp;lt;&amp;lt; Get Name();
columnName[5] &amp;lt;&amp;lt; Get Name();
show(columnName);

N = N Items( columnName );
For(j=1, j&amp;lt;= N, j++,
	x = contains(columnName[j], searchWords);
	myName = Substr(columnName[j] &amp;lt;&amp;lt; Get Name(), x+3);
	If(x  &amp;gt; 0,
		columnName[j] &amp;lt;&amp;lt; Set Name(Left(myName, Length(myName)-1));
	);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;adds colons in front of the column names:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_1-1686646556309.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/53750i4EF8E2CE53D18955/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_1-1686646556309.png" alt="hogi_1-1686646556309.png" /&gt;&lt;/span&gt;&lt;BR /&gt;and then the &lt;STRONG&gt;for&lt;/STRONG&gt; loop runs as expected *)&amp;nbsp;&amp;nbsp;:)&lt;/img&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;*) hm a bit surprising that it works - esp.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;contains(columnName[j], searchWords);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Jun 2023 10:07:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Workflow-builder-error-for-Custom-Action-Error-Send-Expects/m-p/641659#M83874</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-06-13T10:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow builder error for Custom Action (Error: Send Expects Scriptable Object)</title>
      <link>https://community.jmp.com/t5/Discussions/Workflow-builder-error-for-Custom-Action-Error-Send-Expects/m-p/642029#M83902</link>
      <description>&lt;P&gt;Hi hogi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the tip.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added your code into the Workflow Builder step. It was executed without error code, but nothing has changed in the data table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Noted that both of our code (with&amp;amp;without "String") work properly when running with Script window, but somehow it does not work in the WorkFlow Builder.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I figure out that we need to use this instead.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Column(dt, columnName[j])&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code that works with Workflow Builder.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;searchWords = ", ";
columnName = dt &amp;lt;&amp;lt; Get Column Names("String");
N = N Items( columnName );

For(j=1, j&amp;lt;= N, j++,
	x = contains(columnName[j], searchWords);
	colName = Substr(columnName[j], x+length(searchWords));
	If(x  &amp;gt; 0,
		Column(dt, columnName[j]) &amp;lt;&amp;lt; Set Name(Left(colName, Length(colName)-1));
	);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2023 05:18:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Workflow-builder-error-for-Custom-Action-Error-Send-Expects/m-p/642029#M83902</guid>
      <dc:creator>Nita_Natchanok</dc:creator>
      <dc:date>2023-06-14T05:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow builder error for Custom Action (Error: Send Expects Scriptable Object)</title>
      <link>https://community.jmp.com/t5/Discussions/Workflow-builder-error-for-Custom-Action-Error-Send-Expects/m-p/642031#M83903</link>
      <description>&lt;P&gt;Hi hogi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the tip.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added your code into the Workflow Builder step. It was executed without error code, but nothing has changed in the data table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Noted that both of our code (with&amp;amp;without "String") work properly when running with Script window, but somehow it does not work in the WorkFlow Builder.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I figure out that we need to use this instead.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Column(dt, columnName[j])&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Here is the code that works with Workflow Builder.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;searchWords = ", ";
columnName = dt &amp;lt;&amp;lt; Get Column Names("String");
N = N Items( columnName );

For(j=1, j&amp;lt;= N, j++,
	x = contains(columnName[j], searchWords);
	colName = Substr(columnName[j], x+length(searchWords));
	If(x  &amp;gt; 0,
		Column(dt, columnName[j]) &amp;lt;&amp;lt; Set Name(Left(colName, Length(colName)-1));
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Jun 2023 05:20:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Workflow-builder-error-for-Custom-Action-Error-Send-Expects/m-p/642031#M83903</guid>
      <dc:creator>Nita_Natchanok</dc:creator>
      <dc:date>2023-06-14T05:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow builder error for Custom Action (Error: Send Expects Scriptable Object)</title>
      <link>https://community.jmp.com/t5/Discussions/Workflow-builder-error-for-Custom-Action-Error-Send-Expects/m-p/643202#M83986</link>
      <description>&lt;P&gt;Use&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; get column reference(cols);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;to get stable column references.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I just found it in&amp;nbsp;&lt;LI-MESSAGE title="Session 6: Data Tables" uid="637714" url="https://community.jmp.com/t5/JMP-Scripting-Users-Group/Session-6-Data-Tables/m-p/637714#U637714" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;from JSL Scripters Club Webinars.&lt;/P&gt;&lt;P&gt;(highly recommended!!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

cols= dt &amp;lt;&amp;lt; get column names();
colRefs = dt &amp;lt;&amp;lt; get column reference(cols);
// {Column( "name" ), Column( "age" ), Column( "sex" ), Column( "height" ),Column( "weight" )}

// load another table
Open( "$SAMPLE_DATA/Big Class Families.jmp" );	

//Column(cols[1]) &amp;lt;&amp;lt; get name // doesn't work
colRefs[1] &amp;lt;&amp;lt; get name;&amp;nbsp;//&amp;nbsp;still&amp;nbsp;works&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 07:48:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Workflow-builder-error-for-Custom-Action-Error-Send-Expects/m-p/643202#M83986</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-06-27T07:48:53Z</dc:date>
    </item>
  </channel>
</rss>

