<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Index from scriptask output</title><link>https://community.appian.com/discussions/f/process/26400/index-from-scriptask-output</link><description>Hi everyone, 
 I have a scriptask which create an output of type text by running an expression rule, which looks like below: 
 
 I save this output into a process parameter, then plan to use it for the sub-process. 
 If I want to take the updatedRelationship</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Index from scriptask output</title><link>https://community.appian.com/thread/103908?ContentTypeID=1</link><pubDate>Sun, 06 Nov 2022 14:44:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fc4eea97-f793-468c-8ee4-95dc889949c0</guid><dc:creator>mollyn126</dc:creator><description>&lt;p&gt;I just found out the reason which was the scriptask outcome, not the MNI or subprocess itself, so after I fix it and configue the MNI in subprocess appropriately, the data was passed into sub-process successfully. Thanks a lot for your help :D&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Index from scriptask output</title><link>https://community.appian.com/thread/103741?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2022 05:26:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:27bc39c7-0938-46ee-a4db-8db2039d1af1</guid><dc:creator>adityae736199</dc:creator><description>&lt;p&gt;Could you check pv!scriptaskOutcome has any value in the instance or not. And what is the datatype configured for this variable is it of type Map&amp;nbsp;which allows multiple values?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Index from scriptask output</title><link>https://community.appian.com/thread/103737?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2022 02:38:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:36936fc3-4c92-438f-86e7-46c9879bad6c</guid><dc:creator>mollyn126</dc:creator><description>&lt;p&gt;Thanks for the detailed explaination Dimitris. I did&amp;nbsp;configure the MNI and paste below code into the Run as many box&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/14/pastedimage1667356671472v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;However the sub process still wasn&amp;#39;t able to receive any value. I guess it&amp;#39;s the issue with the sciptask outcome data type or the index() thing.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Index from scriptask output</title><link>https://community.appian.com/thread/103724?ContentTypeID=1</link><pubDate>Tue, 01 Nov 2022 18:37:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c98e6a7d-63f1-450a-8d89-815d4d370c4f</guid><dc:creator>Dimitris Soulovaris</dc:creator><description>&lt;p&gt;The problem is that he has not configured the subprocess node to run as an MNI and at the same time he is using the tp!instanceIndex variable. The expression&amp;nbsp;&lt;strong&gt;index(pv!scriptaskOutcome,&amp;quot;updatedRelationships&amp;quot;,tp!instanceIndex, null)&amp;nbsp;&lt;/strong&gt;will work fine if he makes the MNI config.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/14/pastedimage1667327764970v1.png" alt=" " /&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Index from scriptask output</title><link>https://community.appian.com/thread/103723?ContentTypeID=1</link><pubDate>Tue, 01 Nov 2022 18:18:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5c19cde0-bd6a-42cb-8499-0cbd36a00c68</guid><dc:creator>Naresh</dc:creator><description>&lt;p&gt;Hi Mollyn,&lt;/p&gt;
&lt;p&gt;I see you you are providing 4 values inside index function - &lt;strong&gt;index(pv!scriptaskOutcome,&amp;quot;updatedRelationships&amp;quot;,tp!instanceIndex, null)&lt;/strong&gt;. it may be causing your issue. try update your index function it may solve your problem. I would suggest debug this issue first by passing the entire list to your sub process without running MNI and see if the values are coming to sub process or not.&lt;/p&gt;
&lt;p&gt;ex: &lt;strong&gt;index(pv!scriptaskOutcome,&amp;quot;updatedRelationships&amp;quot;, null) &lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Index from scriptask output</title><link>https://community.appian.com/thread/103721?ContentTypeID=1</link><pubDate>Tue, 01 Nov 2022 17:48:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:108a53ec-ee2f-4701-a051-803c33233a44</guid><dc:creator>Dimitris Soulovaris</dc:creator><description>&lt;p&gt;After selecting the &amp;quot;Automatically run multiple instances of this node&amp;quot; option you have to define how many instances of this subprocess will have to run. In the expression editor next to the &amp;quot;Run this many&amp;quot; option you have to insert the following piece of code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;count(
  index(
    pv!scriptaskOutcome,
    &amp;quot;updatedRelationships&amp;quot;,
    &amp;quot;entityId&amp;quot;,
    null
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using count() function and not length() because it&amp;#39;s counting the null values also of the entityId&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Index from scriptask output</title><link>https://community.appian.com/thread/103717?ContentTypeID=1</link><pubDate>Tue, 01 Nov 2022 13:51:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2592fe29-2a8e-4b03-aeba-16129315c49c</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;As Peter noted, tp!instanceindex is not available until you actually configure the node to run as MNI using this checkbox:&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/14/pastedimage1667310703765v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Index from scriptask output</title><link>https://community.appian.com/thread/103687?ContentTypeID=1</link><pubDate>Tue, 01 Nov 2022 04:03:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4fb206c5-721f-4af2-ae15-d366ef56f53e</guid><dc:creator>mollyn126</dc:creator><description>&lt;p&gt;Hi Peter, I want to use the expression output values as the input variables for my sub-process (fileId, relationshipToRemove, updatedRelationships, documentDetails, runDocumentCleanUp, etc. ), below is what I&amp;#39;m doing at the moment:&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/14/pastedimage1667275411428v1.jpeg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;However, I tested and the values didn&amp;#39;t pass into subprocess successfully. I tried your recommendation of removing the &amp;quot;tp!instanceIndex&amp;quot; and it didn&amp;#39;t work either....&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Index from scriptask output</title><link>https://community.appian.com/thread/103647?ContentTypeID=1</link><pubDate>Mon, 31 Oct 2022 13:00:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1d6ffa3f-eb61-4990-956e-441d1f68d6a4</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;In this case you aren&amp;#39;t using the option for &amp;quot;Automatically run multiple instances of this node&amp;quot;, so the tp!instanceIndex variable won&amp;#39;t have a value.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s still unclear to me what you are trying to do - are you trying to create a different sub-process for each item in your list of &amp;quot;updatedRelationships&amp;quot;? If so, then you need to check that box above and&amp;nbsp;&lt;em&gt;then&lt;/em&gt; tp!instanceIndex will work. If you&amp;#39;re not doing that, are you trying to pass a certain index (e.g. the first item)? If so, you can just hardcode 1 into your index() function above. Or another option is you can just pass the entire list into the sub-process and use it there however you need to.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Index from scriptask output</title><link>https://community.appian.com/thread/103622?ContentTypeID=1</link><pubDate>Mon, 31 Oct 2022 04:39:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d26fc538-3eb4-40c8-b9d5-cad0c6e7dae9</guid><dc:creator>mollyn126</dc:creator><description>&lt;p&gt;I just checked, seems like tp!instanceIndex is needed... I&amp;#39;m I right?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/14/pastedimage1667191157041v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Index from scriptask output</title><link>https://community.appian.com/thread/103621?ContentTypeID=1</link><pubDate>Mon, 31 Oct 2022 04:11:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7c072a35-d12c-46fe-9a47-f202d60dd2db</guid><dc:creator>GopalK</dc:creator><description>&lt;p&gt;Hi, are you using MNI on subprocess? if not then you dont need to use&amp;nbsp;tp!instanceIndex. Just index into correct output from the process variable.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>