<?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>Run integration only when users clicks a button on interface</title><link>https://community.appian.com/discussions/f/user-interface/38612/run-integration-only-when-users-clicks-a-button-on-interface</link><description>I have a scenario where the users is viewing an interface from a record action. Before they click submit to complete the record action I want them to click a button that will call an integration and that value returned will either allow them to submit</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Run integration only when users clicks a button on interface</title><link>https://community.appian.com/thread/145826?ContentTypeID=1</link><pubDate>Fri, 28 Feb 2025 22:04:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d69307a4-6804-4455-b617-bfe82503cba6</guid><dc:creator>nancyb0004</dc:creator><description>&lt;p&gt;That did it!&amp;nbsp; Thank you so much!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Run integration only when users clicks a button on interface</title><link>https://community.appian.com/thread/145825?ContentTypeID=1</link><pubDate>Fri, 28 Feb 2025 21:43:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6e8656df-c8c0-406e-ae90-75ac69ec023e</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;OK. That name &amp;quot;UWM_Post_Calculate&amp;quot; points to an integration that might have been configured to &amp;quot;Modify Data&amp;quot;. If this is true, and that integration does NOT modify any data, I suggest to change that configuration to &amp;quot;Queries Data&amp;quot; and this should just work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Run integration only when users clicks a button on interface</title><link>https://community.appian.com/thread/145821?ContentTypeID=1</link><pubDate>Fri, 28 Feb 2025 21:05:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ca129210-8872-4273-9cf3-24ad4de38128</guid><dc:creator>nancyb0004</dc:creator><description>&lt;p&gt;Absolutely!&amp;nbsp;&amp;nbsp;&lt;pre class="ui-code" data-mode="json"&gt;a!localVariables(
  
  
  local!integrationResponse: rule!UWM_POST_Calculate(
    caseId: ri!caseId,
    updatedByUserId:  rule!UWM_Get_User_Id(username: ri!loggedInUserVar),
    updatedByUserFullName:rule!UWM_Get_Full_Name(user: ri!loggedInUserVar),
  ),
  /* Extract the result from the body dictionary */
  local!result: index(local!integrationResponse, &amp;quot;body.result&amp;quot;, false),


  /* Return the appropriate type based on the result */
  if(
    local!result,
    local!result,
    false
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Run integration only when users clicks a button on interface</title><link>https://community.appian.com/thread/145820?ContentTypeID=1</link><pubDate>Fri, 28 Feb 2025 20:52:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ac919af9-f06b-4ce4-a7e8-f4a98b53dcb4</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;What is this expression doing? Can you share the code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Run integration only when users clicks a button on interface</title><link>https://community.appian.com/thread/145819?ContentTypeID=1</link><pubDate>Fri, 28 Feb 2025 20:42:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d25a515c-dea3-4e02-8a9f-d86e79d49b68</guid><dc:creator>nancyb0004</dc:creator><description>&lt;p&gt;I&amp;#39;ve tried that&amp;nbsp;&lt;pre class="ui-code" data-mode="json"&gt;a!localVariables(
  local!loggedInUserVar: fn!loggedInUser(),
  local!isLoading: false,
  local!isValid: false,
  a!sectionLayout(
    contents: {
      a!cardLayout(
        contents: {
          a!buttonArrayLayout(
            buttons: {
              a!buttonWidget(
                label: &amp;quot;Button&amp;quot;,
                icon: &amp;quot;check-double&amp;quot;,
                style: &amp;quot;OUTLINE&amp;quot;,
                saveInto: {
                  a!save(local!isLoading, true)/* Start loading state */,
                  a!save(
                    local!isValid,
                    rule!UWM_Map_Calculate_Data(
                      caseId: ri!case.caseId,
                      loggedInuserVar: local!loggedInUserVar
                    ),
                    
                  )
                },
                disabled: local!isLoading/* Disable button while loading */
                
              )
            },
            align: &amp;quot;START&amp;quot;,
            marginBelow: &amp;quot;NONE&amp;quot;
          ),
          {
            a!richTextDisplayField(
              labelPosition: &amp;quot;COLLAPSED&amp;quot;,
              value: a!richTextItem(
                text: { fn!tostring(local!isValid) },
                style: &amp;quot;STRONG&amp;quot;
              ),
              
            )
          }
        }
      )
    },
    
  ),
  
)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;and when I click the button I get this error:&lt;br /&gt;&lt;br /&gt;&lt;strong class="StrongText---richtext_strong StrongText---inMessageLayout StrongText---error"&gt;Could not display interface. Please check definition and inputs.&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Interface Definition: Expression evaluation error [evaluation ID = 38a99:55128] : An error occurred while executing a save: Expression evaluation error in rule &amp;#39;uwm_map_calculate_data&amp;#39;: An error occurred when creating local!integrationResponse. a!save() and smart service functions cannot be used in a local variable unless &amp;quot;refreshAlways&amp;quot; is true for that local variable using the a!refreshVariable() function.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Run integration only when users clicks a button on interface</title><link>https://community.appian.com/thread/145817?ContentTypeID=1</link><pubDate>Fri, 28 Feb 2025 20:23:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0e1ab9ad-ed2c-4204-8b7a-f01e04892796</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Why not just call that integration inside the saveInto of that button? There is no need to complicate things with this local variables construct.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>