<?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>How can I save the value in different indexes ?</title><link>https://community.appian.com/discussions/f/new-to-appian/25511/how-can-i-save-the-value-in-different-indexes</link><description>Here, If I give quantity value for 1st row then it is coming to all the rows with the same value. Item, ItemName, Price, are in one Rule input and Quantity, Total are belongs to other Ruleinput. How can I save the Quantity value in their indexes ?</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How can I save the value in different indexes ?</title><link>https://community.appian.com/thread/99499?ContentTypeID=1</link><pubDate>Mon, 15 Aug 2022 05:47:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c6a85687-d618-414e-8586-3670675f3563</guid><dc:creator>deepakg681722</dc:creator><description>&lt;p&gt;Instead of a normal local variable, you have to create it with the Map function. Please find the attached code for reference.&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!items: {
    a!map(item: &amp;quot;3&amp;quot;, itemName: &amp;quot;Bag&amp;quot;, price: &amp;quot;1000&amp;quot;),
    a!map(
      item: &amp;quot;1&amp;quot;,
      itemName: &amp;quot;Laptop&amp;quot;,
      price: &amp;quot;50000&amp;quot;
    ),
    a!map(item: &amp;quot;3&amp;quot;, itemName: &amp;quot;Bag&amp;quot;, price: &amp;quot;1000&amp;quot;)
  },
  local!quanPrice: a!forEach(
    items: local!items,
    expression: {
      {
        a!map(
          quantity: 10,
          total: tointeger(fv!item.price) * 10
        )
      }
    }
  ),
  a!gridLayout(
    headerCells: {
      a!gridLayoutHeaderCell(label: &amp;quot;Item&amp;quot;),
      a!gridLayoutHeaderCell(label: &amp;quot;Item Name&amp;quot;),
      a!gridLayoutHeaderCell(label: &amp;quot;Price&amp;quot;),
      a!gridLayoutHeaderCell(label: &amp;quot;Quantity&amp;quot;),
      a!gridLayoutHeaderCell(label: &amp;quot;Total&amp;quot;)
    },
    rows: a!forEach(
      items: local!items,
      expression: {
        a!gridRowLayout(
          id: fv!index,
          contents: {
            a!textField(
              value: fv!item.item,
              saveInto: fv!item.item,
              readOnly: true()
            ),
            a!textField(
              value: fv!item.itemName,
              saveInto: fv!item.itemName,
              readOnly: true()
            ),
            a!textField(
              value: fv!item.price,
              saveInto: fv!item.price,
              readOnly: true()
            ),
            a!textField(
              value: local!quanPrice[fv!index].quantity,
              saveInto: local!quanPrice[fv!index].quantity,
              
            ),
            a!textField(
              value: local!quanPrice[fv!index].total,
              saveInto: local!quanPrice[fv!index].total,
              
            )
          }
        )
      }
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I save the value in different indexes ?</title><link>https://community.appian.com/thread/99490?ContentTypeID=1</link><pubDate>Sat, 13 Aug 2022 05:46:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fd077d4d-1230-4832-825e-041fa74d9962</guid><dc:creator>GopalK</dc:creator><description>&lt;p&gt;Hi, you can use below save configuration to save values at a particular index of a rule input. If you are using forEach loop then you can use fv!index to define your indexes.&lt;/p&gt;
&lt;p&gt;a!save(ri!quantity[index], yourValue)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>