<?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>Getting Data into editable grid</title><link>https://community.appian.com/discussions/f/user-interface/19974/getting-data-into-editable-grid</link><description>Hi, 
 
 I have written the following code where sampleData is a DataStore entity, but I am not getting any data in the front end: 
 rows: a!forEach( items: ri!sampleData, expression: a!gridRowLayout( contents: { a!textField( value: ri!sampleData.Account</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Getting Data into editable grid</title><link>https://community.appian.com/thread/78100?ContentTypeID=1</link><pubDate>Tue, 24 Nov 2020 22:34:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3213f269-1927-4b64-bf6c-ef20addc1471</guid><dc:creator>Pedro Sim&amp;#245;es</dc:creator><description>&lt;p&gt;Karan, you&amp;#39;re trying to edit items from a &amp;quot;DataType&amp;quot; type. Taking that into consideration, your interface&amp;#39;s rule input should be of the &amp;quot;DataType&amp;quot; type and not and not a Data Store Entity. See more of these concepts in the following link (&lt;a href="https://docs.appian.com/suite/help/20.3/Data_Stores.html"&gt;https://docs.appian.com/suite/help/20.3/Data_Stores.html)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Once you have the CDT that you created as the type of your rule input, you will need to test that your interface is&amp;nbsp;working, i.e:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Receives a list of your DataType (you can use a queryEntity on your test)&lt;img src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/13/pastedimage1606257121072v1.png" alt=" " /&gt;&lt;/li&gt;
&lt;li&gt;After updates on the grid, your rule input contains the updated values (check the rule inputs section of your interface designer).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Once you do that, you&amp;#39;re set for success and just need to figure out the where you will use that&amp;nbsp;interface. You can use by itself or with a process model. Both approaches allow to write to the data store entity (&lt;a href="https://docs.appian.com/suite/help/20.3/Write_to_Data_Store_Entity_Smart_Service.html)"&gt;docs.appian.com/.../Write_to_Data_Store_Entity_Smart_Service.html)&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting Data into editable grid</title><link>https://community.appian.com/thread/78099?ContentTypeID=1</link><pubDate>Tue, 24 Nov 2020 22:18:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:11d8fc07-274b-4e0e-a1d2-36b8745185ea</guid><dc:creator>Karanc</dc:creator><description>&lt;p&gt;I want to extract the data from the database in an editable grid so that I add data or update the existing data.&lt;br /&gt;&lt;br /&gt;Steps taken for this:&lt;/p&gt;
&lt;p&gt;1. Created a DataType, which corresponds to the target table in the database&lt;/p&gt;
&lt;p&gt;2. Added DataType in DataStore&lt;/p&gt;
&lt;p&gt;3. Created a constant of the DataType&lt;/p&gt;
&lt;p&gt;4. In the interface created a rule input (sampleData) which is DataStore&lt;/p&gt;
&lt;p&gt;5. Create an editable grid which shows the data (S&lt;strong&gt;tuck Here&lt;/strong&gt;)&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Experiments:&lt;/p&gt;
&lt;p&gt;1. Try to create expression rule name (Add_budget)&lt;/p&gt;
&lt;p&gt;2. Try creating a process model&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Hopefully this helps&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting Data into editable grid</title><link>https://community.appian.com/thread/78098?ContentTypeID=1</link><pubDate>Tue, 24 Nov 2020 22:04:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0821933f-b7be-4e68-9546-076a22e08332</guid><dc:creator>Pedro Sim&amp;#245;es</dc:creator><description>&lt;p&gt;Karan,&lt;/p&gt;
&lt;p&gt;Please&amp;nbsp;shed some more light on what you&amp;#39;re trying to do. Is it to change a set of items and update them in the database? Also please share your rules definitions and code&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting Data into editable grid</title><link>https://community.appian.com/thread/78097?ContentTypeID=1</link><pubDate>Tue, 24 Nov 2020 21:56:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:83d038f4-81a8-4253-b8cc-b8f7e7aa702c</guid><dc:creator>Karanc</dc:creator><description>&lt;p&gt;Pedro,&lt;/p&gt;
&lt;p&gt;I am able to extract data from the rule input with the command&amp;nbsp;&lt;strong&gt;rule!Add_budget().Jan[0] &lt;/strong&gt;(Here Add_budget is an expression rule)&lt;strong&gt;, &lt;/strong&gt;but how to show the same in the editable grid. And also I can&amp;#39;t use the index 1 for every row.&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t figure out why the code is not working in the editable grid, while I am able to extract the data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting Data into editable grid</title><link>https://community.appian.com/thread/78095?ContentTypeID=1</link><pubDate>Tue, 24 Nov 2020 21:49:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a53fc57d-3289-4c2b-aae8-d3b740192966</guid><dc:creator>Pedro Sim&amp;#245;es</dc:creator><description>&lt;p&gt;Karan,&lt;/p&gt;
&lt;p&gt;That depends on how and where you want to use that interface.&amp;nbsp;I suggest you passing as an input the type (CDT) that will be used in the grid.&amp;nbsp;Once you decide on that, you just need to ensure that you&amp;#39;re passing the correct type everywhere you use that interface.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Assuming that &amp;quot;get data from the backend&amp;quot; means getting data from a database, you can create a rule input that will retrieve the data that you want (using queryEntity), cast that data to the proper CDT and then you can reference that rule where you call your interface. Something like this:&lt;/p&gt;
&lt;p&gt;rule!interface(sampleData:rule!GetDataForInterface())&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting Data into editable grid</title><link>https://community.appian.com/thread/78090?ContentTypeID=1</link><pubDate>Tue, 24 Nov 2020 20:40:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cbb6c34d-858b-4e17-adc3-4981f182b7b8</guid><dc:creator>Karanc</dc:creator><description>&lt;p&gt;Hi pedro,&lt;/p&gt;
&lt;p&gt;Sorry for the trouble.&lt;/p&gt;
&lt;p&gt;I read the documentation about appian adding, removing data from the editable grid. It seems like my initial code was quite similar to that, still, I am unable to fetch the data from the backend.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Do I need to create a process model so that the rule Input &lt;strong&gt;Sample data&lt;/strong&gt; can get data from the backend? Or just creating a rule input that contains a Data Store as its type is okay.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting Data into editable grid</title><link>https://community.appian.com/thread/78088?ContentTypeID=1</link><pubDate>Tue, 24 Nov 2020 19:37:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6466789d-d42e-45e6-9e4e-6da0fdbe2463</guid><dc:creator>Pedro Sim&amp;#245;es</dc:creator><description>&lt;p&gt;Karan,&lt;/p&gt;
&lt;p&gt;I must admit that I am a bit confused on what you are trying to achieve. Some thoughts that I hope will help you:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If you want to call an expression rule, you need to add () after their name. So it will be rule!Add_budget().Feb assuming that Feb is a property of a Dictionary/CDT returned by the rule Add_budget. If you just&amp;nbsp;do this simple replacement, you will find issues with your text Field (while changing a certain value)&lt;/li&gt;
&lt;li&gt;If you are trying to have an editable grid with some pre-populated values from a Data Store Entity, consider this example&amp;nbsp;&lt;a href="https://docs.appian.com/suite/help/20.3/recipe-add-edit-and-remove-data-in-an-inline-editable-grid.html"&gt;https://docs.appian.com/suite/help/20.3/recipe-add-edit-and-remove-data-in-an-inline-editable-grid.html&lt;/a&gt;&amp;nbsp;and replace the local variable employee for your CDT (fetch it from the DB and cast it to the respective CDT)&lt;/li&gt;
&lt;li&gt;Assuming that the rule Add_budget is returning a dictionary with some pre-populated values, you can follow the same example mentioned above and construct your map or CDT by using that rule.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Hope this helps,&lt;/p&gt;
&lt;p&gt;Pedro&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting Data into editable grid</title><link>https://community.appian.com/thread/78085?ContentTypeID=1</link><pubDate>Tue, 24 Nov 2020 19:08:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:08683294-4aee-493d-b2d6-d81619e3a136</guid><dc:creator>Karanc</dc:creator><description>&lt;p&gt;Hi Pedro,&lt;/p&gt;
&lt;p&gt;I have written an expression rule name Add_Budget and I am trying to refer to that for data extraction, still, I am not getting any rows in the front end. The modified code&amp;nbsp;is belows:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;rows: a!forEach( items: ri!sampleData,&lt;br /&gt; expression: a!gridRowLayout(&lt;br /&gt; contents: {&lt;br /&gt; a!textField(&lt;br /&gt; value: rule!Add_budget&lt;span&gt;()&lt;/span&gt;.Account,&lt;br /&gt; saveInto: fv!item.Account,&lt;br /&gt; ),&lt;br /&gt; a!textField(&lt;br /&gt; value: rule!Add_budget&lt;span&gt;()&lt;/span&gt;.Jan,&lt;br /&gt; saveInto: fv!item.Jan&lt;br /&gt; ),&lt;br /&gt; a!textField(&lt;br /&gt; value: rule!Add_budget().Feb,&lt;br /&gt; saveInto: fv!item.Feb&lt;br /&gt; ),&lt;br /&gt; a!textField(&lt;br /&gt; value: rule!Add_budget&lt;span&gt;()&lt;/span&gt;.Mar,&lt;br /&gt; saveInto: fv!item.Mar&lt;br /&gt; )&lt;br /&gt; }&lt;br /&gt; )&lt;br /&gt; )&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;/p&gt;
&lt;p&gt;Here the rule Add_budget is an express rule, I have even tried to use just the&amp;nbsp;a!queryEntity to extract the data but nothing seems to work.&amp;nbsp;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you please elaborate on the steps like what should be done?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting Data into editable grid</title><link>https://community.appian.com/thread/78084?ContentTypeID=1</link><pubDate>Tue, 24 Nov 2020 18:27:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:29f25fdf-3450-48d8-9724-c9f065df93c2</guid><dc:creator>Pedro Sim&amp;#245;es</dc:creator><description>&lt;p&gt;Karen,&lt;/p&gt;
&lt;p&gt;Rule Inputs can be&amp;nbsp;associated to several Appian Data Types including any CDT that you might have created. See the&amp;nbsp;following link on how you can use a queryEntity with a cast to a particular CDT (&lt;a href="https://docs.appian.com/suite/help/20.3/Query_Recipes.html#retrieve-the-data-for-all-fields"&gt;https://docs.appian.com/suite/help/20.3/Query_Recipes.html#retrieve-the-data-for-all-fields)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The code that you previously had for the readOnly field would probably generate an error or erroneous behavior. Please consider my previous observation&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting Data into editable grid</title><link>https://community.appian.com/thread/78083?ContentTypeID=1</link><pubDate>Tue, 24 Nov 2020 18:20:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:083ee5e1-335a-4575-91fc-975960121ff2</guid><dc:creator>Karanc</dc:creator><description>&lt;p&gt;Hi pedro,&lt;/p&gt;
&lt;p&gt;I have created the rule input name sampleData which is a DataStore entity.&lt;/p&gt;
&lt;p&gt;Can rule Input store Datatypes? If yes, can you please elaborate a bit on what do you mean sampleDate as input?&lt;span&gt;&amp;nbsp;And how to proceed further for loading the data in the editable grid.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;And I am using readonly, because I want that users can&amp;#39;t change some fields, but that is okay. I can remove that and work on it later.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting Data into editable grid</title><link>https://community.appian.com/thread/78082?ContentTypeID=1</link><pubDate>Tue, 24 Nov 2020 18:10:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e4a6080d-aac7-4561-8aba-ceb889f883ca</guid><dc:creator>Pedro Sim&amp;#245;es</dc:creator><description>&lt;p&gt;Hi Karanc,&lt;/p&gt;
&lt;p&gt;What are you passing as an input (ri!sampleData)?Also please&amp;nbsp;note that your first textField can only contain a reference to value since it&amp;#39;s a readOnly field (see below). I advise you to take a look at the following recipe since it&amp;#39;s quite close to what you are trying to do&amp;nbsp;&lt;a href="https://docs.appian.com/suite/help/20.3/recipe-add-edit-and-remove-data-in-an-inline-editable-grid.html"&gt;docs.appian.com/.../recipe-add-edit-and-remove-data-in-an-inline-editable-grid.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!textField(
value: fv!item.Account,
readOnly: true
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>