<?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 in process model</title><link>https://community.appian.com/discussions/f/new-to-appian/24905/script-task-in-process-model</link><description>Hello community, 
 I am tried to store my all data of form into database, 
 So in that I used more than 1 CDT in my form, and then I am using script task to mapping one ID into other one, and then I am using multiple data store entity 
 to send all data</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: script task in process model</title><link>https://community.appian.com/thread/98555?ContentTypeID=1</link><pubDate>Wed, 27 Jul 2022 16:57:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1971c465-32bb-4b9b-8865-1bda8f09b20b</guid><dc:creator>shrikanthn0001</dc:creator><description>&lt;p&gt;Thank you ,Stefan .It is working now .&amp;nbsp; &lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: script task in process model</title><link>https://community.appian.com/thread/98516?ContentTypeID=1</link><pubDate>Wed, 27 Jul 2022 08:28:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:22886ae1-fd1c-4929-ad1c-ff839c257c82</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Your code in the output of a script task should like something like this&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!foreach(
  items: pv!something,
  expression: a!update(
    fv!item,
    &amp;quot;foreign key field&amp;quot;,
    pv!customer.id
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;a!save() does only work inside a saveInto on UI components.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: script task in process model</title><link>https://community.appian.com/thread/98515?ContentTypeID=1</link><pubDate>Wed, 27 Jul 2022 08:24:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:063a7d91-5555-4221-a437-625709337ca6</guid><dc:creator>shrikanthn0001</dc:creator><description>&lt;p&gt;1 ) Where should I&amp;nbsp; write that code in scripttask&amp;nbsp; ?&amp;nbsp; Is it output tab and expression window&amp;nbsp; ?&lt;/p&gt;
&lt;p&gt;2)&amp;nbsp; below code looks okay ?&lt;/p&gt;
&lt;p&gt;a!forech ( items : transactionrlist&lt;/p&gt;
&lt;p&gt;expression : a!save( fv!item.Foreignkey , id)&lt;/p&gt;
&lt;p&gt;)&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;3) if above code is wrttien in expression editor window ( script task, output tab)&amp;nbsp; then&amp;nbsp; &amp;nbsp;what is the value of target&amp;nbsp; ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: script task in process model</title><link>https://community.appian.com/thread/98511?ContentTypeID=1</link><pubDate>Wed, 27 Jul 2022 08:05:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2995d0a3-3ada-46ba-91b9-3aa2f1712911</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;If you need to insert multiple record into the second table, you might want to use a!update() in a foreach() to update the foreign key in all the records.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: script task in process model</title><link>https://community.appian.com/thread/98510?ContentTypeID=1</link><pubDate>Wed, 27 Jul 2022 07:51:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:812c312c-f89b-4c4c-ae3f-370381e1b467</guid><dc:creator>shrikanthn0001</dc:creator><description>&lt;p&gt;Hi Harshit ,&amp;nbsp; I have inserted data to first table using Write to DSE smart service. Then used script task to reassign the inserted id&amp;nbsp; from the previous step to foreign key of the second table.&amp;nbsp; It asignes&amp;nbsp; foreign key value to the first record and doesn&amp;#39;t assign other record.&amp;nbsp; . In the scrip i used&amp;nbsp; multiple parametr value and it didn&amp;#39;t help&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: script task in process model</title><link>https://community.appian.com/thread/96375?ContentTypeID=1</link><pubDate>Thu, 16 Jun 2022 07:04:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:31a36095-819d-4550-92d4-83bfd6684d22</guid><dc:creator>nitinn0007</dc:creator><description>&lt;p&gt;Thanks for your suggestion.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But If I have to use more than 10 CDT to store and mapping ID, so I have to create 10 Write to DSE and script task for these or use&amp;nbsp; Multiple DSE&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: script task in process model</title><link>https://community.appian.com/thread/96372?ContentTypeID=1</link><pubDate>Thu, 16 Jun 2022 07:00:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0ff143ac-4a10-4f08-9150-61a8bb0c17d9</guid><dc:creator>nitinn0007</dc:creator><description>&lt;p&gt;First I used write to DSE&amp;nbsp; from that I take only 1 CDT in that and I got the ID and that after&amp;nbsp;&lt;em&gt;used script task, and then I used&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Multiple DSE than I am getting all the details in my database&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: script task in process model</title><link>https://community.appian.com/thread/96370?ContentTypeID=1</link><pubDate>Thu, 16 Jun 2022 06:08:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:090393ec-4e18-499a-b443-cca875b1e40b</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;You need to run write to DSE node. NOT write to Multiple DSE.&amp;nbsp;&lt;br /&gt;because you need the ID of first table in the second one. Therefore, you a write to DSE, store the output in the same variable, use a script task to map the id into another table, and then write the second table.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>