<?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>Writing a calculated value to a CDT in an editable grid</title><link>https://community.appian.com/discussions/f/user-interface/11192/writing-a-calculated-value-to-a-cdt-in-an-editable-grid</link><description>I am saving a calculated value inside an editable grid such as column A - B to item as shown below 
 
 
 
 after this i am writing ri!items to a similar CDT . somehow this calculated value is not saving into the CDT. 
 Both are decimal values but somehow</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Writing a calculated value to a CDT in an editable grid</title><link>https://community.appian.com/thread/49131?ContentTypeID=1</link><pubDate>Thu, 05 Oct 2017 15:11:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c32d1e5a-9241-4c5a-88ad-a16879b70fdb</guid><dc:creator>Shreehari Gopalakrishnan Ramanan</dc:creator><description>Thank you Vinay for the idea .&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing a calculated value to a CDT in an editable grid</title><link>https://community.appian.com/thread/49125?ContentTypeID=1</link><pubDate>Thu, 05 Oct 2017 14:25:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:990464d3-b7d5-47a0-84a7-e52848edbf87</guid><dc:creator>Vinay Kumar Rai</dc:creator><description>Hi,&lt;br /&gt;
&lt;br /&gt;
You can save the ri!items[ri!index].difference on ri!items[ri!index].current and ri!items[ri!index].Lastmonth  text field&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing a calculated value to a CDT in an editable grid</title><link>https://community.appian.com/thread/49121?ContentTypeID=1</link><pubDate>Thu, 05 Oct 2017 13:37:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:be7d6901-02a6-4e2a-9da6-6687875501fb</guid><dc:creator>Shreehari Gopalakrishnan Ramanan</dc:creator><description>&lt;p&gt;Thanks .. The given expression is&amp;nbsp;insde a&amp;nbsp; rule!UHC_showItemRowEach. I am calling the rule from an interface where i have the submit button . so i cannot get the same index value inside the button ( or can i ? )&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;   rows: a!applyComponents(
          function: rule!UHC_showItemRowEach(
            items: local!items,
            index: _,
            itemstoken: local!itemsToken
          ),
          array: if(
            or(
              isnull(
                local!items
              ),
              count(
                local!items
              ) &amp;lt; 1
            ),
            {},
            1 + enumerate(
              count(
                local!items
              )
            )
          ),&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing a calculated value to a CDT in an editable grid</title><link>https://community.appian.com/thread/49114?ContentTypeID=1</link><pubDate>Thu, 05 Oct 2017 12:08:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0d571a2b-3d6c-4cb5-8efd-3772cb8f2786</guid><dc:creator>Shyam Bommakanti</dc:creator><description>&lt;p&gt;Value expression executes while displaying. The save/saveinto gets executed only when something is changed in the associated field.&lt;/p&gt;
&lt;p&gt;So, what you see on the UI is not being saved.&lt;/p&gt;
&lt;p&gt;To test this out under the grid have a textfields displaying the CDT(s) to see how the values are being changed&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!textField(
    label: &amp;quot;ri!items&amp;quot;,
    readonly: true,
    value: ri!items
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing a calculated value to a CDT in an editable grid</title><link>https://community.appian.com/thread/49112?ContentTypeID=1</link><pubDate>Thu, 05 Oct 2017 11:58:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:abbc31dc-9882-43b8-805b-f571ad2c7973</guid><dc:creator>vijayd</dc:creator><description>Since the value is read only, perform the expression on the button field.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing a calculated value to a CDT in an editable grid</title><link>https://community.appian.com/thread/49110?ContentTypeID=1</link><pubDate>Thu, 05 Oct 2017 11:54:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5afa830a-8629-49d5-b7e5-40d5fecef6a1</guid><dc:creator>annap</dc:creator><description>As textField is readOnly and you are not editing the value so that its saveInto not get execute. &lt;br /&gt;
Use same expression &amp;quot; a!save(ri!itemstoken,append(ri!itemstoken,save!value))&amp;quot;  in Submit buttons saveInto.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing a calculated value to a CDT in an editable grid</title><link>https://community.appian.com/thread/49109?ContentTypeID=1</link><pubDate>Thu, 05 Oct 2017 11:45:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7f00f1a3-7282-4a03-a54a-9fccfd3f233b</guid><dc:creator>satyaa</dc:creator><description>a!save() will not get executed in readOnly fields. You should try to save the same value by other means.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing a calculated value to a CDT in an editable grid</title><link>https://community.appian.com/thread/49108?ContentTypeID=1</link><pubDate>Thu, 05 Oct 2017 11:43:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bc65d277-8901-41c9-a4d9-e39453f8c4c1</guid><dc:creator>Vinay Kumar Rai</dc:creator><description>Hi,&lt;br /&gt;
&lt;br /&gt;
When you update the value on the textfield then the saveInto opetation is perform, In you case the textfield is readonly so no saveInto will perform. You can save the difference on ri!items[ri!index].current and ri!items[ri!index].Lastmonth field&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>