<?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>I want to subtract the value of a process variable from a specific field and process the result by branching.</title><link>https://community.appian.com/discussions/f/process/30724/i-want-to-subtract-the-value-of-a-process-variable-from-a-specific-field-and-process-the-result-by-branching</link><description>I am a beginner with Appian. In the interface, I input values for each field of a record type and save them to process variables. In the process model, I want to reference the same record, subtract a specific field from the corresponding process variable</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: I want to subtract the value of a process variable from a specific field and process the result by branching.</title><link>https://community.appian.com/thread/122321?ContentTypeID=1</link><pubDate>Tue, 28 Nov 2023 07:46:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a2feb074-7a4e-42d5-87b3-15da479fc3d7</guid><dc:creator>taiyof4139</dc:creator><description>&lt;p&gt;Resolved.&lt;br /&gt;Thank you very much.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I want to subtract the value of a process variable from a specific field and process the result by branching.</title><link>https://community.appian.com/thread/122311?ContentTypeID=1</link><pubDate>Tue, 28 Nov 2023 01:16:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e65df6bb-52be-439b-8d33-c2d2c97a57b6</guid><dc:creator>taiyof4139</dc:creator><description>&lt;p&gt;Thank you for your response.&lt;/p&gt;
&lt;p&gt;I have a basic question regarding the process model, and I apologize if it seems elementary. I am struggling to understand how to reference a specific record within multiple records in a record type.&lt;/p&gt;
&lt;p&gt;Specifically, I would like to know how to reference the same record as the one set in a process variable. My goal is to subtract values from the process variable based on the current value of a specific field.&lt;/p&gt;
&lt;p&gt;To clarify this issue, I would greatly appreciate your guidance.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I want to subtract the value of a process variable from a specific field and process the result by branching.</title><link>https://community.appian.com/thread/122296?ContentTypeID=1</link><pubDate>Mon, 27 Nov 2023 16:14:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:500f6b79-7c5f-488e-a533-15babd5b64de</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;So like any development in any language you&amp;#39;ll need to break this down into discrete pieces of code (objects in the case of Appian). I encourage those on my Dev teams to create micro-designs for their features (I do this myself - it often saves me from going&amp;nbsp;down&amp;nbsp; an wrong path when developing the code)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;User Interface - you don&amp;#39;t say how a User will initially access this User Interface. So that&amp;#39;s missing from your description above. But once in the UI you&amp;#39;ll need to have input fields that match the type of data&amp;nbsp;for each of the record type attributes that you want to process. These should be mapped to the Interface&amp;#39;s rule inputs and made available to the process model&amp;#39;s variables.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Process Model - once you have the values the user entered in the Interface now in your process variables you can then use a Script Task to perform the subtraction as you describe. Since in one of you possible outcomes you need access to the result of this calculation you&amp;#39;ll need the Script Task to store the result in another process variable. I suggest you consider a naming scheme that makes it clear what the original value is, what the user-entered value is and what the result is (e.g &amp;lt;record type&amp;gt;.&amp;lt;attributeName&amp;gt;, &amp;lt;attributeNameUserValue&amp;gt;, &amp;lt;attributeNameResult&amp;gt;&lt;/li&gt;
&lt;li&gt;Since you&amp;#39;re going to send an email either way you don&amp;#39;t need to branch the process flow (no XOR required) but what you do want to do is set the value you&amp;#39;re going to use in that email according to the rules you outline. Use a Script Task to write the desired value to the &amp;lt;&lt;span&gt;attributeNameResult&amp;gt; process variable and use this in your Send Email smart service&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>