<?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 to create a total field</title><link>https://community.appian.com/discussions/f/data/21906/how-to-create-a-total-field</link><description>Hi, 
 I&amp;#39;m new to Appian and I&amp;#39;d like to create a total field. 
 example: 
 field1+ 
 field2 + 
 field3+ 
 field4 
 ------- 
 total 
 
 and I&amp;#39;d like to display the total in a text field 
 thanks,</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to create a total field</title><link>https://community.appian.com/thread/85826?ContentTypeID=1</link><pubDate>Thu, 16 Sep 2021 16:16:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6c9caab2-89e0-41ae-b229-3b70e6782175</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I dunno, I always recomment just switching over to Expression Mode (and staying there).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to create a total field</title><link>https://community.appian.com/thread/85824?ContentTypeID=1</link><pubDate>Thu, 16 Sep 2021 15:25:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:514b1818-3671-4d01-9320-4124eca53950</guid><dc:creator>Omar Ali</dc:creator><description>&lt;p&gt;this may seem stupid but where do I go to create local variables? in the interface builder there is a section for local variables but there is no add button.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to create a total field</title><link>https://community.appian.com/thread/85819?ContentTypeID=1</link><pubDate>Thu, 16 Sep 2021 14:20:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3f99775d-54b4-4b63-bf06-18bcca40e150</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Here&amp;#39;s a quick example of how I would structure this - this only has 2 initial values but can be scaled to pretty much as many as you want.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!localVariables(
  local!item1: 0,
  local!item2: 0,
  
  local!total: local!item1 + local!item2,
  
  a!formLayout(
    label: &amp;quot;Addition example&amp;quot;,
    contents: {
      a!textField(
        label: &amp;quot;Value 1:&amp;quot;,
        value: local!item1,
        required: true(),
        saveInto: {a!save(local!item1, tointeger(save!value))}
      ),
      a!textField(
        label: &amp;quot;Value 2:&amp;quot;,
        value: local!item2,
        required: true(),
        saveInto: a!save(local!item2, tointeger(save!value))
      ),
      a!textField(
        label: &amp;quot;Totals:&amp;quot;,
        readOnly: true(),
        value: local!total
      )
    },
    buttons: a!buttonLayout(
      primaryButtons: {
        a!buttonWidget(
          label: &amp;quot;Submit&amp;quot;,
          saveInto: {
            a!save(
              ri!evaluatedTotal,
              local!total
            )
          }
        )
      }
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to create a total field</title><link>https://community.appian.com/thread/85818?ContentTypeID=1</link><pubDate>Thu, 16 Sep 2021 14:13:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3d73dca2-e193-4ece-b49c-20fe772ebcf0</guid><dc:creator>Omar Ali</dc:creator><description>&lt;p style="font-family:Calibri;font-size:11.0pt;margin:0in;"&gt;Hi Mike,&lt;/p&gt;
&lt;p style="font-family:Calibri;font-size:11.0pt;margin:0in;"&gt;I was charged by my organization to evaluate Appian. I have created a form where employees submit a training request including the cost of the training. I have a section for inputting the cost with 4 decimal fields(tuition cost, living cost&amp;hellip;.etc) to input the financial information and 1 field to save the total of the cost. It is all part of an approval process where the employee submit the form a manager recommend it and finally an executive will approve it. I need help to saving the total cost in a Totalcost field.&lt;/p&gt;
&lt;p style="font-family:Calibri;font-size:11.0pt;margin:0in;"&gt;Thanks mike for your it is really appreciated.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to create a total field</title><link>https://community.appian.com/thread/85813?ContentTypeID=1</link><pubDate>Thu, 16 Sep 2021 13:35:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4ce20fbd-72af-4ca8-ae90-6b9d1cd0e028</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;This depends a bit on the context of what you&amp;#39;re trying to do and where/how.&amp;nbsp; Is this a form used on a Task in a running process model?&amp;nbsp; If so, the easiest way I&amp;#39;ve found to do something like this is to have your Submit button save the calculated value into a Rule Input, passing that value back into the process where you can use it for whatever you were wanting.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to create a total field</title><link>https://community.appian.com/thread/85812?ContentTypeID=1</link><pubDate>Thu, 16 Sep 2021 13:28:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e5d02fd3-b749-46ec-9213-58e1ece51690</guid><dc:creator>Omar Ali</dc:creator><description>&lt;p&gt;Hi Mike,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I was able to display the total amount of the 4 fields in a text field but how can I save the sum of 4 fields in my total fields. In powerApps , you just need to create a calculated field but I don&amp;#39;t know how it works in Appian.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to create a total field</title><link>https://community.appian.com/thread/85810?ContentTypeID=1</link><pubDate>Thu, 16 Sep 2021 13:05:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:82e23359-bd12-40aa-8f08-da317d542cd9</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;The simplest way by far would be to create a 5th text field below the previous 4, and set it to readOnly with a value of &amp;quot;ri!field1 + ri!field2 ...&amp;quot; etc.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>