<?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>Saving user input values in cdts from the editable grid</title><link>https://community.appian.com/discussions/f/user-interface/11378/saving-user-input-values-in-cdts-from-the-editable-grid</link><description>Hi, 
 I have editable grid having two columns one is readonly field for showing label and in the second column the user will enter the data. The data for this columns is getting from a local variable . The user can delete the rows and he add row upto</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Saving user input values in cdts from the editable grid</title><link>https://community.appian.com/thread/65892?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2019 13:10:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:230e6be1-e6c2-4b9c-80ac-d94414bf1d8f</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Yeah, it turns out things get a little more tricky if you start using the &amp;quot;select all&amp;quot; checkboxes, which I was not originally testing as I was selecting individual rows by default.&lt;/p&gt;
&lt;p&gt;Please note that using the &amp;quot;select all&amp;quot; checkbox in one grid seems to deselect all items from the other grid as they both use a shared selected items list.&amp;nbsp; But manually checking individual items, it should work fine to select different items from different sections.&amp;nbsp; The following revision of my original code from above does some more careful typecasting on the indexes to avoid the error message you had reported even when the Select All boxes are utilized.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!groceryList: {
    {
      id: 1,
      name: &amp;quot;Milk&amp;quot;,
      orderNum: null(),
      category: &amp;quot;Food&amp;quot;
    },
    {
      id: 2,
      name: &amp;quot;Tide Pods&amp;quot;,
      orderNum: null(),
      category: &amp;quot;Cleaning Supplies&amp;quot;
    },
    {
      id: 3,
      name: &amp;quot;Eggs&amp;quot;,
      orderNum: null(),
      category: &amp;quot;Food&amp;quot;
    },
    {
      id: 4,
      name: &amp;quot;Paper Towels&amp;quot;,
      orderNum: null(),
      category: &amp;quot;Cleaning Supplies&amp;quot;
    }
  },
  local!categories: union(local!grocerylist.category, local!groceryList.category),
  local!selectedItems: tointeger({}),
  
  a!sectionLayout(
    contents: {
      
      a!forEach(
        local!categories,
        
        with(
          local!currentCategory: fv!item,
          a!gridLayout(
            label: fv!item,
            headerCells: {
              a!gridLayoutHeaderCell(label: &amp;quot;Item&amp;quot;),
              a!gridLayoutHeaderCell(label: &amp;quot;Order&amp;quot;)
            },
            selectable: true(),
            selectionSaveInto: {
              a!save(
                local!selectedItems,
                a!forEach(
                  save!value,
                  if(isnull(fv!item), {}, fv!item)
                )
              )
            },
            selectionValue: local!selectedItems,
            /*selectionStyle: &amp;quot;ROW_HIGHLIGHT&amp;quot;,*/
            
            rows: a!forEach(
              local!groceryList,
              if(
                fv!item.category = local!currentCategory,
                a!gridRowLayout(
                  id: tointeger(fv!item.id),
                  contents: {
                    a!richTextDisplayField(
                      label: &amp;quot;Item Name Display&amp;quot;,
                      value: a!richTextItem(
                        text: fv!item.name
                      )
                    ),
                    a!textField(
                      label: &amp;quot;Order Number Editor&amp;quot;,
                      value: fv!item.orderNum,
                      saveInto: {
                        fv!item.orderNum
                      },
                      disabled: not(
                        contains(
                          tointeger(local!selectedItems),
                          tointeger(fv!item.id)
                        )
                      )
                    )
                  }
                  ),
                {}
              )
            )
          )
        )
      ),
        
      
      a!boxLayout(
        label: &amp;quot;DEBUG&amp;quot;,
        style: &amp;quot;INFO&amp;quot;,
        isCollapsible: true(),
        isInitiallyCollapsed: true(),
        contents: {
          a!paragraphField(
            value: &amp;quot;Selections: &amp;quot; &amp;amp; local!selectedItems &amp;amp; char(10) &amp;amp;
              &amp;quot;CDT Data: &amp;quot; &amp;amp; local!groceryList
          )
        }
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Saving user input values in cdts from the editable grid</title><link>https://community.appian.com/thread/65882?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2019 07:51:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d9e3bfd1-6ce3-4e86-9c68-39592dea2c77</guid><dc:creator>chandhinir</dc:creator><description>&lt;p&gt;Thanks Reggie!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Saving user input values in cdts from the editable grid</title><link>https://community.appian.com/thread/65873?ContentTypeID=1</link><pubDate>Sun, 14 Apr 2019 09:13:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6414ae7f-c419-499d-b246-5c2b5ed9e013</guid><dc:creator>Reggie</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!groceryList: {
    {
      id: 1,
      name: &amp;quot;Milk&amp;quot;,
      orderNum: null(),
      category: &amp;quot;Food&amp;quot;
    },
    {
      id: 2,
      name: &amp;quot;Tide Pods&amp;quot;,
      orderNum: null(),
      category: &amp;quot;Cleaning Supplies&amp;quot;
    },
    {
      id: 3,
      name: &amp;quot;Eggs&amp;quot;,
      orderNum: null(),
      category: &amp;quot;Food&amp;quot;
    },
    {
      id: 4,
      name: &amp;quot;Paper Towels&amp;quot;,
      orderNum: null(),
      category: &amp;quot;Cleaning Supplies&amp;quot;
    }
  },
  local!categories: union(local!grocerylist.category, local!groceryList.category),
  local!selectedItems: {},
  
  a!sectionLayout(
    contents: {
      
      a!forEach(
        local!categories,
        
        with(
          local!currentCategory: fv!item,
          {
            a!gridLayout(
              label: fv!item,
              headerCells: {
                a!gridLayoutHeaderCell(label: &amp;quot;Item&amp;quot;),
                a!gridLayoutHeaderCell(label: &amp;quot;Order&amp;quot;)
              },
              selectable: true(),
              selectionSaveInto: {
                local!selectedItems
              },
              selectionValue: local!selectedItems,
              selectionStyle: &amp;quot;ROW_HIGHLIGHT&amp;quot;,
              
              rows: a!forEach(
                local!groceryList,
                if(
                  fv!item.category = local!currentCategory,
                  a!gridRowLayout(
                    id: fv!item.id,
                    contents: {
                      a!richTextDisplayField(
                        label: &amp;quot;Item Name Display&amp;quot;,
                        value: a!richTextItem(
                          text: fv!item.name
                        )
                      ),
                      a!textField(
                        label: &amp;quot;Order Number Editor&amp;quot;,
                        value: fv!item.orderNum,
                        saveInto: {
                          fv!item.orderNum
                        },
                        disabled: not(
                          contains(
                            tointeger(local!selectedItems),
                            tointeger(fv!item.id)
                          )
                        )
                      )
                    }
                    ),
                  {}
                )
              )
            ),
            a!buttonLayout(
              secondaryButtons: {
                a!buttonWidget(
                  label:&amp;quot;Select All&amp;quot;, 
                  saveInto: a!save(
                    local!selectedItems, 
                    append(
                      local!selectedItems,
                      index(
                        local!groceryList.id, 
                        wherecontains(local!currentCategory,touniformstring(property(local!groceryList, &amp;quot;category&amp;quot;, {}))), 
                        {}
                      )
                    )
                  )
                ), 
                a!buttonWidget(
                  label:&amp;quot;Deselect All&amp;quot;, 
                  saveInto: a!save(
                    local!selectedItems, 
                    remove(
                      local!selectedItems,
                      wherecontains(
                        index(
                          local!groceryList.id, 
                          wherecontains(local!currentCategory,touniformstring(property(local!groceryList, &amp;quot;category&amp;quot;, {}))), 
                          {}
                        ), 
                        local!selectedItems
                      )
                    )
                  )
                )
              }
            )
          }
        )
      ),
      a!boxLayout(
        label: &amp;quot;DEBUG&amp;quot;,
        style: &amp;quot;INFO&amp;quot;,
        isCollapsible: true(),
        isInitiallyCollapsed: true(),
        contents: {
          a!paragraphField(
            value: &amp;quot;Selections: &amp;quot; &amp;amp; local!selectedItems &amp;amp; char(10) &amp;amp;
              &amp;quot;CDT Data: &amp;quot; &amp;amp; local!groceryList
          )
        }
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="/members/chandhinir"&gt;chandhinir&lt;/a&gt;&amp;nbsp;One alternative solution to this issue is to add &amp;amp; change the selectionStyle to &amp;#39;ROW_HIGHLIGHT&amp;quot; and add&amp;nbsp; SELECT/DE-SELECT ALL buttons below the grid(s) using the design Mike has already provided (which includes my changes - see code above). With the addition of the buttons, Mike&amp;#39;s solution worked fine for me.&lt;br /&gt;&lt;br /&gt;It may also be helpful to add instructions so that users are made aware to literally select the rows they want to enable.&lt;br /&gt;&lt;br /&gt;I didn&amp;#39;t see any viable solutions (in terms of complexity) that would work out when the&amp;nbsp;checkbox to select all rows is de-selected, so I figured the above solution would be fine.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;One quirk&lt;/strong&gt; you&amp;#39;d have to address though:&lt;br /&gt;&lt;br /&gt;1. When the user accidentally clicks the select all button but all the available rows, for the given grid, have already been selected (you&amp;#39;ll understand if you refer to the debug field)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Just so you&amp;#39;re aware, I am also using 18.4&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Saving user input values in cdts from the editable grid</title><link>https://community.appian.com/thread/65872?ContentTypeID=1</link><pubDate>Sun, 14 Apr 2019 02:34:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:50db28b6-8bec-4d07-a3cb-009ea839b05c</guid><dc:creator>chandhinir</dc:creator><description>&lt;p&gt;I am on Appian version 18.4.&lt;br /&gt;I&amp;nbsp;was getting this error (&lt;span&gt;&amp;nbsp;Expression evaluation error at function &amp;#39;contains&amp;#39; [line 67]: Invalid types, can only act on data of the same type (Any Type, Number (Integer)). So did casting.&lt;br /&gt;&lt;br /&gt;There were two sections Food and Cleaning supplies.&lt;br /&gt;First I selected all items under food Section and enter the order no .When I selected the second section Cleaning supplies , the selection made in Food section lost&amp;nbsp; and only the selection in second grid retained.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Saving user input values in cdts from the editable grid</title><link>https://community.appian.com/thread/65868?ContentTypeID=1</link><pubDate>Sat, 13 Apr 2019 14:43:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7c95e6fe-8b2e-48bf-857a-1f67fd2939ef</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Did you change anything from my example? &amp;nbsp;I have to double check but it seemed to work for me no matter which section I selected items from. &amp;nbsp;What happens wrong exactly? &amp;nbsp;Also can you confirm what Appian version you&amp;#39;re on?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Saving user input values in cdts from the editable grid</title><link>https://community.appian.com/thread/65867?ContentTypeID=1</link><pubDate>Sat, 13 Apr 2019 14:16:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d2b93ff1-e071-4221-9db2-18e77f5cc81e</guid><dc:creator>chandhinir</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;Thanks!&lt;br /&gt;I tried the new code but grid selection is not retained when i select&amp;nbsp;multiple sections.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Saving user input values in cdts from the editable grid</title><link>https://community.appian.com/thread/65865?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2019 18:25:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a3745a4c-7ec9-414f-9594-d87a00078b3f</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;BTW, I have reproduced a partially-simplified version of your use case using my own new code.&amp;nbsp; In the case of this sample code it seems to work when I enter order numbers.&amp;nbsp; Please try this out and see if it helps you with your specific implementation.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;load(
  local!groceryList: {
    {
      id: 1,
      name: &amp;quot;Milk&amp;quot;,
      orderNum: null(),
      category: &amp;quot;Food&amp;quot;
    },
    {
      id: 2,
      name: &amp;quot;Tide Pods&amp;quot;,
      orderNum: null(),
      category: &amp;quot;Cleaning Supplies&amp;quot;
    },
    {
      id: 3,
      name: &amp;quot;Eggs&amp;quot;,
      orderNum: null(),
      category: &amp;quot;Food&amp;quot;
    },
    {
      id: 4,
      name: &amp;quot;Paper Towels&amp;quot;,
      orderNum: null(),
      category: &amp;quot;Cleaning Supplies&amp;quot;
    }
  },
  local!categories: union(local!grocerylist.category, local!groceryList.category),
  local!selectedItems: {},
  
  a!sectionLayout(
    contents: {
      
      a!forEach(
        local!categories,
        
        with(
          local!currentCategory: fv!item,
          a!gridLayout(
            label: fv!item,
            headerCells: {
              a!gridLayoutHeaderCell(label: &amp;quot;Item&amp;quot;),
              a!gridLayoutHeaderCell(label: &amp;quot;Order&amp;quot;)
            },
            selectable: true(),
            selectionSaveInto: {
              local!selectedItems
            },
            selectionValue: local!selectedItems,
            /*selectionStyle: &amp;quot;ROW_HIGHLIGHT&amp;quot;,*/
            
            rows: a!forEach(
              local!groceryList,
              if(
                fv!item.category = local!currentCategory,
                a!gridRowLayout(
                  id: fv!item.id,
                  contents: {
                    a!richTextDisplayField(
                      label: &amp;quot;Item Name Display&amp;quot;,
                      value: a!richTextItem(
                        text: fv!item.name
                      )
                    ),
                    a!textField(
                      label: &amp;quot;Order Number Editor&amp;quot;,
                      value: fv!item.orderNum,
                      saveInto: {
                        fv!item.orderNum
                      },
                      disabled: not(
                        contains(
                          local!selectedItems,
                          fv!item.id
                        )
                      )
                    )
                  }
                  ),
                {}
              )
            )
          )
        )
      ),
        
      
      a!boxLayout(
        label: &amp;quot;DEBUG&amp;quot;,
        style: &amp;quot;INFO&amp;quot;,
        isCollapsible: true(),
        isInitiallyCollapsed: true(),
        contents: {
          a!paragraphField(
            value: &amp;quot;Selections: &amp;quot; &amp;amp; local!selectedItems &amp;amp; char(10) &amp;amp;
              &amp;quot;CDT Data: &amp;quot; &amp;amp; local!groceryList
          )
        }
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Saving user input values in cdts from the editable grid</title><link>https://community.appian.com/thread/65861?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2019 17:38:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d8dfe885-58db-4272-a273-5654db22ec68</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Are you saying questions won&amp;#39;t have an Order value by default?&amp;nbsp; Why?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Saving user input values in cdts from the editable grid</title><link>https://community.appian.com/thread/65859?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2019 16:49:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f4612941-66b3-4b7e-9a2d-fb0b78c2b8ad</guid><dc:creator>chandhinir</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!selectedSections: {
    {
      &amp;quot;sectionId&amp;quot;: 1,
      &amp;quot;sectionName&amp;quot;: &amp;quot;Section1&amp;quot;
    },
    {
      &amp;quot;sectionId&amp;quot;: 2,
      &amp;quot;sectionName&amp;quot;: &amp;quot;Section2&amp;quot;
    }
  },
  local!selectedSectionQuestions: {
    {
      &amp;quot;pId&amp;quot;: 1,
      &amp;quot;question&amp;quot;: &amp;quot;e1&amp;quot;,
      &amp;quot;orderNo&amp;quot;: null,
      &amp;quot;refSectionId&amp;quot;: 1
    },
    {
      &amp;quot;pId&amp;quot;: 2,
      &amp;quot;question&amp;quot;: &amp;quot;e2&amp;quot;,
      &amp;quot;orderNo&amp;quot;: null,
      &amp;quot;refSectionId&amp;quot;: 1
    },
    {
      &amp;quot;pId&amp;quot;: 3,
      &amp;quot;question&amp;quot;: &amp;quot;p1&amp;quot;,
      &amp;quot;orderNo&amp;quot;: null,
      &amp;quot;refSectionId&amp;quot;: 2
    },
    {
      &amp;quot;pId&amp;quot;: 4,
      &amp;quot;question&amp;quot;: &amp;quot;p2&amp;quot;,
      &amp;quot;orderNo&amp;quot;: null,
      &amp;quot;refSectionId&amp;quot;: 2
    },
    {
      &amp;quot;pId&amp;quot;: 5,
      &amp;quot;question&amp;quot;: &amp;quot;p3&amp;quot;,
      &amp;quot;orderNo&amp;quot;: null,
      &amp;quot;refSectionId&amp;quot;: 2
    }
  },
  local!selectedQuestions:type!question_cdt(),
  with(
    {a!forEach(
      items: local!selectedSections,
      expression: rule!TEST_uiDisplayQuestion(
        questions: local!selectedSectionQuestions,
        showWhen: 1,
        sections: fv!item,
        selectedSectionQuestions: local!selectedQuestions
      )
    )}
  )
)
--------------
TEST_uiDisplayQuestion

load(
  local!questions: index(
    ri!questions,
    wherecontains(
      tointeger(
        ri!sections.sectionId
      ),
      tointeger(
        ri!questions.refSectionId
      )
    ),
    {}
  ),
  local!sequence: a!forEach(
    items: local!questions,
    expression: null
  ),
  local!selectedIndices: tointeger(
    {}
  ),
  {
    a!sectionLayout(
      label: ri!sections.sectionName,
      contents: {
        a!gridLayout(
          label: &amp;quot;&amp;quot;,
          headerCells: {
            a!gridLayoutHeaderCell(
              label: &amp;quot;Available Questions&amp;quot;
            ),
            a!gridLayoutHeaderCell(
              label: &amp;quot;Order No&amp;quot;
            )
          },
          columnConfigs: {
            a!gridLayoutColumnConfig(
              width: &amp;quot;DISTRIBUTE&amp;quot;,
              weight: 1
            ),
            a!gridLayoutColumnConfig(
              width: &amp;quot;NARROW&amp;quot;
            )
          },
          rows: a!forEach(
            items: local!questions,
            expression: a!gridRowLayout(
              id: fv!item.pId,
              contents: {
                a!paragraphField(
                  label: &amp;quot;available questions&amp;quot;,
                  labelPosition: &amp;quot;ABOVE&amp;quot;,
                  value: fv!item.question,
                  readOnly: true
                ),
                a!integerField(
                  label: &amp;quot;orderNo&amp;quot;,
                  labelPosition: &amp;quot;ABOVE&amp;quot;,
                  value: fv!item.orderNo,
                  saveInto: {
                    fv!item.orderNo,
                    local!sequence[fv!index]
                  },
                  disabled: rule!APN_isBlank(
                    wherecontains(
                      tointeger(
                        fv!item.pId
                      ),
                      tointeger(
                        local!selectedIndices
                      )
                    )
                  ),
                  required: if(
                    contains(
                      tointeger(
                        local!selectedIndices
                      ),
                      wherecontains(
                        local!selectedIndices,
                        tointeger(
                          fv!item.pId
                        )
                      )
                    ),
                    true,
                    false
                  )
                )
              }
            )
          ),
          selectionValue: local!selectedIndices,
          selectionSaveInto: {
            local!selectedIndices,
            a!save(
              local!selectedIndices,
              reject(
                fn!isnull(
                  _
                ),
                save!value
              )
            ),
            a!forEach(
              items: local!questions,
              expression: {
                a!save(
                  local!sequence[wherecontains(
                    tointeger(
                      fv!item.pId
                    ), tointeger(
                      local!selectedIndices
                    )
                  )],
                  if(
                    contains(
                      tointeger(
                        local!selectedIndices
                      ),
                      wherecontains(
                        tointeger(
                          fv!item.pId
                        ),
                        tointeger(
                          local!selectedIndices
                        )
                      )
                    ),
                    local!sequence[wherecontains(
                      tointeger(
                        fv!item.pId
                      ), tointeger(
                        local!selectedIndices
                      )
                    )],
                    null
                  )
                )
              }
            ),
            a!save(
              ri!selectedQuestions,
              index(
                local!questions,
                wherecontains(
                  tointeger(
                    local!selectedIndices
                  ),
                  tointeger(
                    local!questions.pId
                  )
                ),
                {}
              )
            )
          },
          selectable: true,
          selectionRequired: true
        )
      }
    )
  }
)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Saving user input values in cdts from the editable grid</title><link>https://community.appian.com/thread/65858?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2019 16:44:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:419c80b1-0ff5-4708-a0a1-d7fe88b3cd51</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Thanks for your reply - before I dig into your code I have a suggestion/request - maybe you could edit your post and put your sample code in a Code box - use the &amp;quot;insert&amp;quot; tool on the toolbar of the editor then choose &amp;quot;insert code&amp;quot;, and paste your code there instead - that allows it to maintain formatting as well as not extending your comment window to extreme lengths.&amp;nbsp; Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Saving user input values in cdts from the editable grid</title><link>https://community.appian.com/thread/65857?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2019 16:32:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:451c59d6-03c9-4e6a-ba67-4928884a0322</guid><dc:creator>chandhinir</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;Thanks for your reply. Please find the answers below:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Reason for order no: There will be a chance of having more questions related to same section.if i open up the order no for editing by default, might be difficult to identify which questions the user has selected.&lt;br /&gt;Only for the selected question,I need order no to be entered.same order no conflicts will be handled through validations in the order no field.&lt;/li&gt;
&lt;li&gt;I have not tried this approach.&lt;/li&gt;
&lt;li&gt;Can you post some sample code?&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Saving user input values in cdts from the editable grid</title><link>https://community.appian.com/thread/65856?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2019 16:04:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e410bae8-61a0-442b-b7b9-4026b3031725</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Interesting use case.&amp;nbsp; Some follow-up questions from me:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;What is the reasoning behind making the Order Number box editable only when the row is selected?&amp;nbsp; How do you plan to handle conflicts i.e. a user changes the &amp;quot;1&amp;quot; from your screenshot to &amp;quot;2&amp;quot;, even though there already is a &amp;quot;2&amp;quot;?&lt;/li&gt;
&lt;li&gt;Have you considered implementing &amp;quot;move up / move down&amp;quot; links in their own column?&amp;nbsp; I&amp;#39;ve done this before and it&amp;#39;s fairly easy - the &amp;quot;move&amp;quot; link for any particular row can automatically handling switching the &amp;quot;order number&amp;quot; values in the background with the preceding / following row (depending on which one is clicked), and removes some manual hassle from the user.&amp;nbsp; Now that we can use RichTextIcons, I believe you can have both in a single column if you want.&lt;/li&gt;
&lt;li&gt;Can you post some sample code?&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Saving user input values in cdts from the editable grid</title><link>https://community.appian.com/thread/65855?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2019 15:56:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:30b5e39c-6ead-4fd3-9749-f50182cc8891</guid><dc:creator>chandhinir</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;My requirement is to create dynamic sections with grid layout&amp;nbsp; based on the dropdown selection.&lt;br /&gt;Columns in grid:&lt;br /&gt;- Question(Read Only)&lt;br /&gt;- Order No (Editable) - On load ,the order no field is disabled.&lt;br /&gt;Once the row is selected, the order no field will be enabled and the value will be saved in cdt variable.&lt;/p&gt;
&lt;p&gt;I am facing issues when saving the order no values into cdt. Each row&amp;#39;s order number field value overwrites when other row is selected.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks in advance!&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/13/Screen-Shot-2019_2D00_04_2D00_12-at-10.23.46-PM.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Saving user input values in cdts from the editable grid</title><link>https://community.appian.com/thread/50046?ContentTypeID=1</link><pubDate>Mon, 13 Nov 2017 16:11:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8637bc88-d091-4de9-bc70-f081b4d723b0</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;This is a fairly straightforward case for an editable grid.&amp;nbsp; If you&amp;#39;re using 17.2 or above, you can also do it without even needing to declare a sub-rule (at least for starters).&amp;nbsp; See below example.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  
  local!data: {
    {
      id: 1,
      label: &amp;quot;r1&amp;quot;,
      value: &amp;quot;&amp;quot;
    },
    {
      id: 2,
      label: &amp;quot;r2&amp;quot;,
      value: &amp;quot;&amp;quot;
    }
  },
  
  a!sectionLayout(
    label: &amp;quot;Test Editable Grid&amp;quot;,
    contents: {
      a!paragraphField(
        label: &amp;quot;DEBUG&amp;quot;,
        showWhen: false(),
        value: local!data,
        disabled: true()
      ),
      
      a!gridLayout(
        headerCells: {
          a!gridLayoutHeaderCell(label: &amp;quot;Label&amp;quot;),
          a!gridLayoutHeaderCell(label: &amp;quot;Value&amp;quot;)
        },
        rows: a!forEach(
          local!data,
          a!gridRowLayout(
            contents: {
              a!textField(
                value: fv!item.label,
                readOnly: true()
              ),
              a!textField(
                value: fv!item.value,
                saveInto: fv!item.value
              )
            }
          )
        ),
        addRowLink: if(
          length(local!data) &amp;lt; 5,
          a!dynamicLink(
            label: &amp;quot;Add Row&amp;quot;,
            saveInto: a!save(
              local!data,
              append(
                local!data,
                {
                  id: max(local!data.id)+1,
                  label: &amp;quot;r&amp;quot; &amp;amp; max(local!data.id)+1,
                  value: null()
                }
              )
            )
          ),
          null()
        )
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Saving user input values in cdts from the editable grid</title><link>https://community.appian.com/thread/50030?ContentTypeID=1</link><pubDate>Mon, 13 Nov 2017 05:41:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c8976a64-0031-49f6-bd48-f77991ac87b2</guid><dc:creator>santoshd378</dc:creator><description>Anyone got solution for this?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Saving user input values in cdts from the editable grid</title><link>https://community.appian.com/thread/50027?ContentTypeID=1</link><pubDate>Mon, 13 Nov 2017 00:39:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2acec573-ddf7-4bd4-8f4b-e884e6c09494</guid><dc:creator>santoshd378</dc:creator><description>&lt;p&gt;Yes, id is an identifier,&lt;br /&gt; In my editable grid there will be two columns, in 1st column just label will be displayed and in second column a text box will be provided to save the value.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Saving user input values in cdts from the editable grid</title><link>https://community.appian.com/thread/50021?ContentTypeID=1</link><pubDate>Sun, 12 Nov 2017 18:00:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b45ad04c-69f6-4012-bed4-962eba823288</guid><dc:creator>Reggie</dc:creator><description>&lt;p&gt;Santosh, could you tell me if my assumptions below are correct? &lt;br /&gt; &lt;br /&gt;1. ID is just an auto-generated number which would serve as the identifier in a grid&lt;br /&gt;2. A label is just context to the value. In other words, the label tells the user what the value is for.&lt;br /&gt;3. Value is provided by the user which could be anything(?)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Saving user input values in cdts from the editable grid</title><link>https://community.appian.com/thread/50019?ContentTypeID=1</link><pubDate>Sun, 12 Nov 2017 06:20:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:22d457a4-d73f-4576-bef2-d73d9a4b2f9b</guid><dc:creator>santoshd378</dc:creator><description>&lt;p&gt;my local variable: &lt;/p&gt;
&lt;p&gt;local!data: &amp;#123;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;#123;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;id: 1,&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;label: &amp;quot;r1&amp;quot;,&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;value: &amp;quot;&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;#125;,&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;#123;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;id: 2,&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;label: &amp;quot;r2&amp;quot;,&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;value: &amp;quot;&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;#125;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;#125;,&lt;/p&gt;
&lt;p&gt;The data entered by user will be inserted into value parameter of the local variable.&lt;/p&gt;
&lt;p&gt;And eventually the data need to be entered to particular field of cdt. &lt;/p&gt;
&lt;p&gt;Is it possible or can anyone suggest what should be the structure of cdt to save the data. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Saving user input values in cdts from the editable grid</title><link>https://community.appian.com/thread/50018?ContentTypeID=1</link><pubDate>Sat, 11 Nov 2017 16:42:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f13db9db-59f2-4045-9387-9a1703f306e4</guid><dc:creator>Reggie</dc:creator><description>&lt;p&gt;You can just a!save() into the CDT with the local! values like below:&lt;br /&gt; &lt;br /&gt;a!save(ri!CDT.field, index(local!data, &amp;quot;fieldName&amp;quot;, null)) &amp;lt;-- you may need an additional level of indexing if the data is nested and/or use type casting if the data types would differ&lt;br /&gt; &lt;br /&gt;You could also build an expression rule, that would be applied over using apply(), to construct the data into the given CDT and save it all in one shot (assuming this is when they submit the form, in a &amp;#39;saveInto&amp;#39;, use the examples below:&lt;br /&gt; &lt;br /&gt;&lt;strong&gt;--Rule being used/referenced--&lt;/strong&gt;&lt;br /&gt;a!save(&lt;br /&gt;ri!cdtName, &lt;br /&gt;apply(&lt;br /&gt;rule!AppName_buildCDTName(_), &lt;br /&gt;local!varName /* &amp;lt;---This is assuming you&amp;#39;re saving all the user&amp;#39;s entries into a single variable */&lt;br /&gt;)&lt;br /&gt; &lt;br /&gt;&lt;strong&gt;--Within rule!AppName_buildCDTName--&lt;/strong&gt;&lt;br /&gt;&amp;#39;type!{namespace}CDTName&amp;#39;(&lt;br /&gt;r1:index(ri!varName, &amp;quot;fieldName&amp;quot;, null),&lt;br /&gt;r2:index(ri!varName, &amp;quot;fieldName&amp;quot;, null),&lt;br /&gt;r3:index(ri!varName, &amp;quot;fieldName&amp;quot;, null),&lt;br /&gt;r4:index(ri!varName, &amp;quot;fieldName&amp;quot;, null),&lt;br /&gt;r5:index(ri!varName, &amp;quot;fieldName&amp;quot;, null)&lt;br /&gt;)&lt;br /&gt; &lt;br /&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;/span&gt;: Don&amp;#39;t forget null checks on the a!save()&lt;br /&gt; &lt;br /&gt;You may also have to do some tinkering with the above code, but the options above should generally give you what you want. If you want a more precise answer, please provide the data structure of your local variable after the user has saved X entries.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>