<?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>Editable Grid with dateField not updating due to index.</title><link>https://community.appian.com/discussions/f/user-interface/19271/editable-grid-with-datefield-not-updating-due-to-index</link><description>I am configuring an editable grid. I have a couple readOnly fields that get populated based on what the user selects in one of the other editable fields. 
 In this specific case, if the user selects a specific account number (the dropDownField(), the</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Editable Grid with dateField not updating due to index.</title><link>https://community.appian.com/thread/75507?ContentTypeID=1</link><pubDate>Wed, 22 Jul 2020 14:27:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c3a210d6-6807-4f0a-a278-fcc49cdf6506</guid><dc:creator>judym598</dc:creator><description>&lt;p&gt;Unfortunately, that didn&amp;#39;t work for sorting the local!selectedRows. I&amp;#39;m moving on from here - at least the data is correct! in all likelihood, the selections would be made in order.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid with dateField not updating due to index.</title><link>https://community.appian.com/thread/75467?ContentTypeID=1</link><pubDate>Mon, 20 Jul 2020 13:18:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:dd47a0d4-1c94-41d7-905a-358e86a3d5e4</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Hi  - As I mentioned in an earlier reply (which i think you may have missed), having a &amp;quot;saveInto&amp;quot; in a Read Only field will literally do nothing, as the saveInto parameter only executes upon user interaction with that field.&amp;nbsp; You need to add your extra save information into the saveInto parameter of the Account Number field, if it&amp;#39;s by interaction with that field that you want the date in question to get updated.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid with dateField not updating due to index.</title><link>https://community.appian.com/thread/75454?ContentTypeID=1</link><pubDate>Mon, 20 Jul 2020 02:39:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b3c186d7-f032-4bd0-9fb4-46b81a935858</guid><dc:creator>judym598</dc:creator><description>&lt;p&gt;Got another question here on my date field. I don&amp;#39;t want the user to edit the value (which i why it is readOnly), but I want it updated if the user changes the account number to &amp;#39;today()&amp;#39;. What I have below displays the correct date in the form but it does not save it to the local variable - therefore, it does not get saved once I leave the form. How do I get the local variable to update? I tried using a!save (see last line) to force it to save to the local variable, but it&amp;#39;s not.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;a!dateField(&lt;br /&gt;&amp;nbsp; label: &amp;quot;Effective Date &amp;quot;&amp;amp; fv!index,&lt;br /&gt;&amp;nbsp; value: if(fv!item.accountNum = ri!newAccount_cdt.accountNum,&amp;nbsp;today(),&amp;nbsp;ri!newArngmt_cdt.effectiveDate),&lt;br /&gt;&amp;nbsp; saveInto: fv!item.effectiveDate,&lt;br /&gt; &amp;nbsp; readOnly: true&lt;br /&gt; )&lt;/p&gt;
&lt;p&gt;Tried this for the saveInto - but it didn&amp;#39;t work:&lt;/p&gt;
&lt;p&gt;saveInto: a!save(fv!item.effectiveDate,local!newArngmt.effectiveDate)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid with dateField not updating due to index.</title><link>https://community.appian.com/thread/75443?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 19:32:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2bab4e24-6eac-432c-976f-9f07bee083ac</guid><dc:creator>judym598</dc:creator><description>&lt;p&gt;Thank you Mike. I think that will work. I will update this thread on Monday if it does - maybe it will help others out.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid with dateField not updating due to index.</title><link>https://community.appian.com/thread/75442?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 18:53:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4a014cc4-47bd-4bbf-9ae2-fe79dc7080c7</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Basically I just mean moving the &amp;quot;data:&amp;quot; field from your read-only grid into a local variable above the grid definition.&amp;nbsp; I could give you pointers on executing the save in an order-preserving manner if you got that part taken care of.&lt;/p&gt;
&lt;p&gt;Alternatively, the one supported method for sorting a CDT (i.e. in your grid&amp;#39;s saveInto), would be to call toDataSubset on it and pass in paging info with sorting on the column you&amp;#39;d want to sort by.&amp;nbsp; The result of this would be that the ri!newArngmt_cdt data would be sorted by that column regardless of the selection order OR current sorting of the paging grid (which i suppose is probably what you want).&lt;/p&gt;
&lt;p&gt;For this, and bear with my guesswork here, but I assume you could replace this&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!save(ri!newArngmt_cdt, local!selectedRows)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;with something like this (assuming for example&amp;#39;s sake that you want it to be sorted on &amp;quot;accountNum&amp;quot;) --&lt;br /&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!save(
  ri!newArngmt_cdt,
  todatasubset(
    local!selectedRows,
    a!pagingInfo(
      startIndex: 1,
      batchSize: -1,
      sort: a!sortInfo(
        field: &amp;quot;accountNum&amp;quot;,
        ascending: true()
      )
    )
  ).data
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid with dateField not updating due to index.</title><link>https://community.appian.com/thread/75441?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 18:46:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2d7df331-3df9-4364-9f52-5e7f1ec2cad2</guid><dc:creator>judym598</dc:creator><description>&lt;p&gt;Wow....are there instructions on how to do that in the documentation? I take it there&amp;#39;s no way to &amp;#39;sort&amp;#39; on a local!variable..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid with dateField not updating due to index.</title><link>https://community.appian.com/thread/75440?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 18:42:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:18dcbc92-16e8-46e8-b239-289e85bf7c33</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;That&amp;#39;s a tricky one.&amp;nbsp; Since you&amp;#39;re querying the data for the read-only grid directly within the read-only grid, the one idea i had is basically out the window.&amp;nbsp; In that, every time the user did a selection, you&amp;#39;d build the array of selected row data by iterating over the original data set and adding every member that corresponded with the index of the new selection (keeping the ordering consistent regardless of additions or deletions).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid with dateField not updating due to index.</title><link>https://community.appian.com/thread/75439?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 14:47:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1c4545a9-7009-4169-925d-ca19afc4842b</guid><dc:creator>judym598</dc:creator><description>&lt;p&gt;Please see the attached. Note that it is not complete. I&amp;#39;ve added comments at the top to explain what my intentions are.&lt;a href="https://community.appian.com/cfs-file/__key/communityserver-discussions-components-files/13/gridUpdates.txt"&gt;community.appian.com/.../gridUpdates.txt&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid with dateField not updating due to index.</title><link>https://community.appian.com/thread/75438?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 14:31:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2d3eaa9e-219c-4cf8-a8b3-84fb34080c2a</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;How are you currently assembling the array of data used for the editable grid, based on the user&amp;#39;s selections from the read-only grid?&amp;nbsp; Mind sharing a snippet of the relevant code?&amp;nbsp; I&amp;#39;d guess you could likely keep the editable lines in the original order pretty easily but again it sorta depends on the specifics.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid with dateField not updating due to index.</title><link>https://community.appian.com/thread/75437?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 14:26:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a7d595ee-5c1a-4a8d-be50-c9d7ace96ae8</guid><dc:creator>judym598</dc:creator><description>&lt;p&gt;I was afraid you&amp;#39;d say that.&amp;nbsp;What I&amp;#39;m doing is&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1) Displaying data in a read only grid (from an expression rule the uses an a!queryEntity) - and allowing the user to select the items to edit which then gets stored into another rule input.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2) The editable grid then displays with the data selected.&amp;nbsp;if the user selects them in order - they will display correctly, but if the user selects the bottom one first, then the 2nd one - they will display in the order selected on the first grid.&lt;/p&gt;
&lt;p&gt;I have to keep the data &amp;#39;local&amp;#39; until the updates are approved - before committing the changes to the database. Is there a way to sort the data in the rule input that is selected in the first grid?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid with dateField not updating due to index.</title><link>https://community.appian.com/thread/75436?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 14:20:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:985aa79a-0c90-4257-bfd0-3a649c8a5175</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="2799" url="~/discussions/f/user-interface/19271/editable-grid-with-datefield-not-updating-due-to-index/75435"]how do I get the data displayed in the editable grid to sort[/quote]
&lt;p&gt;Effectively the only way I&amp;#39;d recommend attempting to sort an editable grid is to sort the data ahead of time - if you&amp;#39;re querying the underlying data on-form, for example, just sort by whichever field you want in the initial query.&amp;nbsp; If you&amp;#39;re using a passed-in rule input, then you could attempt to massage the data before rendering it on the grid, but this gets super messy and cumbersome; if at all possible i&amp;#39;d recommend editing the process model to either query the data in a sorted manner or perhaps sort it for you before entering the task.&amp;nbsp; Again this all depends on how and when you&amp;#39;re querying/assembling the data used for the grid.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid with dateField not updating due to index.</title><link>https://community.appian.com/thread/75435?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 14:12:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:079fc075-a508-4c10-afdd-f7228e03694b</guid><dc:creator>judym598</dc:creator><description>&lt;p&gt;Good catch Mike! I should have had ri!newArngmt_cdt.effectiveDate! Once I changed that - it worked. THANK YOU!!!&lt;/p&gt;
&lt;p&gt;a!dateField(&lt;br /&gt; label: &amp;quot;Effective Date &amp;quot;&amp;amp; fv!index,&lt;br /&gt; value: if(fv!item.accountNum = ri!newAccount_cdt.accountNum,&lt;br /&gt; today(),&lt;br /&gt; ri!newArngmt_cdt.effectiveDate),&lt;br /&gt; saveInto: fv!item.effectiveDate,&lt;br /&gt;readOnly: true&lt;br /&gt; )&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;One other question on this - how do I get the data displayed in the editable grid to sort by the id?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid with dateField not updating due to index.</title><link>https://community.appian.com/thread/75434?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 14:06:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cb919b6b-3ce8-4eb2-9646-e4cce005f766</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;Doh! That&amp;#39;ll teach me to read the code properly...yes, I agree..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid with dateField not updating due to index.</title><link>https://community.appian.com/thread/75433?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 14:06:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2428c36e-2839-42bf-b411-87d7e1f60c42</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Why are you filling out the saveInto parameter for a Read Only date field?&amp;nbsp; This is not needed and won&amp;#39;t do anything.&amp;nbsp; Any chance the error goes away if you comment it out?&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/13/pastedimage1594994779326v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;If you still get the error after commenting that out, then replace &amp;quot;ri!selectedAccount_cdt.effectiveDate&amp;quot; with &amp;quot;&lt;em&gt;property(ri!selectedAccount_cdt, &amp;quot;effectiveDate&amp;quot;, null())&lt;/em&gt;&amp;quot;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid with dateField not updating due to index.</title><link>https://community.appian.com/thread/75432?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 14:03:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1d1ff7e0-8cbe-4851-a545-1d5da48aa84b</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;It could also be ri!selectedAccount_cdt that doesn&amp;#39;t have the &amp;#39;effectiveDate&amp;#39; property - in fact that would be my first guess over fv!item based on the current setup.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid with dateField not updating due to index.</title><link>https://community.appian.com/thread/75430?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 14:00:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5b57ab6c-3338-4e1d-bc49-ff22b7f1d452</guid><dc:creator>judym598</dc:creator><description>&lt;p&gt;items: local!updatedArngmt - which is used to update records in a rule input associated with a data entity. The data entity does have a datefield called &amp;#39;effectiveDate&amp;#39; If I leave it as an edited field - I can update the date just fine. For some reason - it won&amp;#39;t update based on the selection made in the previous instance. Does the Data Entity have to have an index on the date field? I know the other text field does. I also thought that if I could have the data displayed in the editable grid sorted by id - it might help too.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Editable Grid with dateField not updating due to index.</title><link>https://community.appian.com/thread/75429?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 13:50:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7a5ca4e6-09bc-4068-9f13-a20d316eda14</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;The error suggests that your fv!item object does not have a property called &amp;#39;effectiveDate&amp;#39; - are you able to share the data type that is associated with an instance of fv!item?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>