<?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>Retrieve a value from a field</title><link>https://community.appian.com/discussions/f/general/14603/retrieve-a-value-from-a-field</link><description>Hello, I have a question how can I retrieve a value from a field of a cdt and also put it in another table when I make a call in the process model? Thanks</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Retrieve a value from a field</title><link>https://community.appian.com/thread/65486?ContentTypeID=1</link><pubDate>Fri, 29 Mar 2019 07:25:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0900854c-c7f3-414f-aca7-63d5fe32817b</guid><dc:creator>Alastr</dc:creator><description>&lt;p&gt;&lt;span&gt;I have the expression rule...b&lt;/span&gt;ut do not do this part&lt;/p&gt;
&lt;p&gt;&amp;quot;Call the expression rule from the script task inside a process model in the custom outputs section and save it into a process variable of type cdt for second table. Use write to data store smart service to write the data from the second table cdt to your table.&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;with(&lt;/span&gt;&lt;br /&gt;&lt;span&gt; a!queryEntity(&lt;/span&gt;&lt;br /&gt;&lt;span&gt; entity: cons!CPRO_CT_DS_docs,&lt;/span&gt;&lt;br /&gt;&lt;span&gt; query: a!query(&lt;/span&gt;&lt;br /&gt;&lt;span&gt; filter: a!queryFilter(&lt;/span&gt;&lt;br /&gt;&lt;span&gt; field: &amp;quot;doc&amp;quot;,&lt;/span&gt;&lt;br /&gt;&lt;span&gt; operator: &amp;quot;=&amp;quot;,&lt;/span&gt;&lt;br /&gt;&lt;span&gt; value: ri!doc&lt;/span&gt;&lt;br /&gt;&lt;span&gt; ),&lt;/span&gt;&lt;br /&gt;&lt;span&gt; pagingInfo: a!pagingInfo(1,-1)&lt;/span&gt;&lt;br /&gt;&lt;span&gt; ) &lt;/span&gt;&lt;br /&gt;&lt;span&gt; ).data&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;Now with the value &amp;quot;[Document: 7917]&amp;quot; from the table &amp;quot;docs&amp;quot; It is necessary to recover the &amp;quot;id&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt; associated with that document And entered in the field &amp;quot;idSolic&amp;quot; of the other cdt. but this in a script task&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieve a value from a field</title><link>https://community.appian.com/thread/65456?ContentTypeID=1</link><pubDate>Thu, 28 Mar 2019 12:14:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ed97799d-06a8-40b1-85d1-3b56de37baab</guid><dc:creator>Aditya</dc:creator><description>&lt;p&gt;Hi Alastr,&lt;/p&gt;
&lt;p&gt;You will need to use two write to datastore smart service for this in your process model. One for first table and the next for second table.&lt;/p&gt;
&lt;p&gt;Inside the properties of write to datastore smart service of the first table, in the data-&amp;gt;output tab, save stored values parameter to the cdt of first table. Then, after the write to data store smart service of the first table&amp;nbsp;add a script task and add a input parameter there of type cdt of second table. Then expand that input parameter and go to the field idSo. There, in the value parameter, assign firstTableCDT.id and in the saveInto parameter assign secondTableCDT.idSo, then in the second write to datastore smart service, write the data to second table.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieve a value from a field</title><link>https://community.appian.com/thread/65455?ContentTypeID=1</link><pubDate>Thu, 28 Mar 2019 11:33:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bbe2a53c-86cb-42c9-82a7-0a461ad61adb</guid><dc:creator>Alastr</dc:creator><description>&lt;pre class="tw-data-text tw-ta tw-text-small" id="tw-target-text" dir="ltr"&gt;&lt;span lang="en"&gt;Thank you for the answer.
In both cdts I have the field id, but in the first cdt it is called &amp;quot;id&amp;quot;
and in the second &amp;quot;idSo&amp;quot;.
The process model with a form is filled in and sent.
Then the data is saved in the two tables and the process is finished.
in the first table a value is generated that is saved in &amp;quot;id&amp;quot;, because also
I need that value to be saved in the other table in the &amp;quot;idSo&amp;quot; field&lt;/span&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieve a value from a field</title><link>https://community.appian.com/thread/65452?ContentTypeID=1</link><pubDate>Thu, 28 Mar 2019 10:06:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:41f78f68-38f8-4dc6-b8c9-b058b5851d2e</guid><dc:creator>Aditya</dc:creator><description>&lt;p&gt;Create an expression rule will return a dictionary of the cdt fields for the second table. Pass your first cdt to that rule. Use index or property function or dot operator to get the value of a field from your first cdt and put it in a field in your second cdt.&lt;/p&gt;
&lt;p&gt;Call the expression rule from the script task inside a process model in the custom outputs section and save it into a process variable of type cdt for second table. Use write to data store smart service to write the data from the second table cdt to your table.&lt;/p&gt;
&lt;p&gt;For eg., your expression rule will look something like:&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;id:ri!firstCDT.id,&lt;/p&gt;
&lt;p&gt;name:ri!firstCDT.name,&lt;/p&gt;
&lt;p&gt;age:ri!firstCDT.age&lt;/p&gt;
&lt;p&gt;}&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>