<?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>Script task not evaluating expression.</title><link>https://community.appian.com/discussions/f/process/18843/script-task-not-evaluating-expression</link><description>Hi, 
 I am using script task to evaluate expression in process model,but I am getting below error: 
 
 In script task using expression rule to get file name,I have tested expression rule its giving me correct file name and document in also moved in Knowledge</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Script task not evaluating expression.</title><link>https://community.appian.com/thread/74092?ContentTypeID=1</link><pubDate>Thu, 14 May 2020 14:56:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c1276a10-2eda-458d-b710-22050e7b962a</guid><dc:creator>maryam0001</dc:creator><description>&lt;p&gt;Hey Manuel,&lt;/p&gt;
&lt;p&gt;Thanks for looking into it will paste step by step execution.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Script task not evaluating expression.</title><link>https://community.appian.com/thread/74091?ContentTypeID=1</link><pubDate>Thu, 14 May 2020 14:53:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f7209e47-5896-4179-a0c8-b2902777e650</guid><dc:creator>maryam0001</dc:creator><description>&lt;p&gt;Thanks Mike will do.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Script task not evaluating expression.</title><link>https://community.appian.com/thread/74072?ContentTypeID=1</link><pubDate>Thu, 14 May 2020 14:07:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4b42338a-00f6-417f-995d-664a4cba8943</guid><dc:creator>ManuelHTG</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;You might want to do an execution step by step and paste here the details, including the PV variables &amp;amp; expression rules variables.&lt;/p&gt;
&lt;p&gt;An explanation of what is the logic behind would help like&lt;/p&gt;
&lt;p&gt;The user can upload multiple files.&lt;/p&gt;
&lt;p&gt;&amp;quot;fileNames&amp;quot; is an text array with the name of the files.&lt;/p&gt;
&lt;p&gt;The expression rule MOC... gets XYZ parameters and returns a text array&lt;/p&gt;
&lt;p&gt;etc&lt;/p&gt;
&lt;p&gt;Without being a bit more specific, we cannot really help.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Script task not evaluating expression.</title><link>https://community.appian.com/thread/74071?ContentTypeID=1</link><pubDate>Thu, 14 May 2020 14:05:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b9e79649-f8df-413d-9840-a260c40ea644</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;This still isn&amp;#39;t quite enough information to do anything but guess, but my current best guess is that you could just add some null checking before you call the document() function, because in the error you originally posted it&amp;#39;s getting a null or invalid value at some point.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Script task not evaluating expression.</title><link>https://community.appian.com/thread/74069?ContentTypeID=1</link><pubDate>Thu, 14 May 2020 13:39:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8783780c-c718-4f11-81b2-06c06dbed670</guid><dc:creator>maryam0001</dc:creator><description>&lt;p&gt;Hey Mike,&lt;/p&gt;
&lt;p&gt;Yes I have added only mandatory values in expression rule to get filenames as a result of expression evaluation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Script task not evaluating expression.</title><link>https://community.appian.com/thread/74068?ContentTypeID=1</link><pubDate>Thu, 14 May 2020 13:36:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7c93125b-a2e5-451c-96cd-0d4fcc05e309</guid><dc:creator>maryam0001</dc:creator><description>&lt;p&gt;The only PV which have attachment is pv!counterPartyCommunicationDetails,and also in expression rule mandatory values are of pv!&lt;span&gt;counterPartyCommunicationDetails.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;at line 126&amp;nbsp; using document function to get document name .&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;document(&lt;br /&gt; tointeger(&lt;br /&gt; index(&lt;br /&gt; fv!item,&lt;br /&gt; &amp;quot;emailAttachment&amp;quot;,&lt;br /&gt; null&lt;br /&gt; )&lt;br /&gt; ),&lt;br /&gt; &amp;quot;name&amp;quot;&lt;br /&gt; )&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Script task not evaluating expression.</title><link>https://community.appian.com/thread/74065?ContentTypeID=1</link><pubDate>Thu, 14 May 2020 13:13:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:960e0953-daae-4fcf-a418-9322d71069e7</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;But in the process model we can see you&amp;#39;re passing in a value for the subcaseDetails rule input, and in this test you aren&amp;#39;t.&amp;nbsp; We can&amp;#39;t really tell what other things may have changed since you haven&amp;#39;t posted the full code you&amp;#39;re using in the process model.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Script task not evaluating expression.</title><link>https://community.appian.com/thread/74064?ContentTypeID=1</link><pubDate>Thu, 14 May 2020 11:54:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ab5d5c1a-338e-4a59-97f9-2c42e6426635</guid><dc:creator>ManuelHTG</dc:creator><description>&lt;p&gt;What with the other PV as well at the same time. What do you have in line 126?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Script task not evaluating expression.</title><link>https://community.appian.com/thread/74063?ContentTypeID=1</link><pubDate>Thu, 14 May 2020 11:52:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:80b6ca54-9ea8-47db-be95-49e0ab6b68c0</guid><dc:creator>maryam0001</dc:creator><description>&lt;p&gt;yes I did test the expression rule with the value of pv!counterPartyCommunicationDetails,its returning me correct fileNames:&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/14/pastedimage1589457179098v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;But in ProcessModel facing error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Script task not evaluating expression.</title><link>https://community.appian.com/thread/74062?ContentTypeID=1</link><pubDate>Thu, 14 May 2020 11:45:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:19d4a82f-2d52-4903-aa7c-4d8a927164c5</guid><dc:creator>ManuelHTG</dc:creator><description>&lt;p&gt;Did you run the expression rule with the same data that in the process model to see what happens? specially with the value of this one pv!counterPartyCommunicationDetails&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Script task not evaluating expression.</title><link>https://community.appian.com/thread/74061?ContentTypeID=1</link><pubDate>Thu, 14 May 2020 11:32:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0cd502a9-c96a-43ab-81ff-fa0d178fd72d</guid><dc:creator>maryam0001</dc:creator><description>&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/14/pastedimage1589455825455v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/14/pastedimage1589455963946v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;this is process model which I am using and the node details&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Script task not evaluating expression.</title><link>https://community.appian.com/thread/74060?ContentTypeID=1</link><pubDate>Thu, 14 May 2020 11:26:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6fc6af24-6089-4f46-b9a6-f89b91431fc8</guid><dc:creator>ManuelHTG</dc:creator><description>&lt;p&gt;that seems a strange way of setting the node. I would try to start as simple as possible and then adding complexity, the load there does not make sense to me and without further details of how did you set up the node, it is impossible to help you debug &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Script task not evaluating expression.</title><link>https://community.appian.com/thread/74059?ContentTypeID=1</link><pubDate>Thu, 14 May 2020 11:20:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:711df88e-4147-459d-be8d-5e5986a8b65a</guid><dc:creator>maryam0001</dc:creator><description>&lt;p&gt;I tried it with removing load and document comes in pv!counterPartyCommunicationDetails.Its a CDT which have emailAttachment column where I&amp;nbsp; am passing my document.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Script task not evaluating expression.</title><link>https://community.appian.com/thread/74057?ContentTypeID=1</link><pubDate>Thu, 14 May 2020 10:01:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:734cb2ec-d48b-43aa-aa4d-a89c300d5d6e</guid><dc:creator>ManuelHTG</dc:creator><description>&lt;p&gt;why do you have a load at the begging?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I suspect you should pass a document to your expression rule and you are not doing it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>