<?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>Issue when pressed submit button</title><link>https://community.appian.com/discussions/f/user-interface/23305/issue-when-pressed-submit-button</link><description>Hi All, 
 I have a simple audit form as interface used for auditing between members. 
 I am trying to configure as below, 
 When details are entered and pressed on submit that need to save the details in database which is happening successfully except</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Issue when pressed submit button</title><link>https://community.appian.com/thread/89456?ContentTypeID=1</link><pubDate>Tue, 04 Jan 2022 11:44:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:425ddb60-e0da-4016-b7a2-db14e9477349</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;On submit button, you can run a forEach() loop to iterate through the list of variables (CDT), and for each item, you can use the sum of all the previous &amp;#39;price&amp;#39; values to generate the balance left value. Please find a snippet below.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!money: 1000,
  local!items: {
    { price: 500 },
    { price: 70 },
    { price: 10 },
    { price: 200 }
  },
  a!forEach(
    items: local!items,
    expression: {
      price: fv!item.price,
      balance_left: todecimal(local!money) - sum(
        todecimal(
          index(
            todecimal(local!items.price),
            enumerate(fv!index) + 1,
            {}
          )
        )
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>