Skip to main content
October 31, 2023
Solved

Button clicked twice does not appear to function

  • October 31, 2023
  • 8 replies
  • 0 views

I have a SAIL form that displays CDT data which ultimate came from a web service.  There is a button on the interface to refresh the data.  Clicking this button invokes an expression rule which calls an integration to retrieve the latest data to return to the interface.  The data in the external system changes based on actions taken by users that also use the SAIL form.  Users know when they need to click the refresh button to see the newest data.

When the form is opened (it opens from a workflow task), the data is displayed.  When the refresh button is clicked, the data is updated and the new data is displayed.  So far, so good.

However, when the button is clicked a second time while the task remains open, the data is not refreshed and the interface shows the old data.  When clicked a third time, same result (no refresh).  Fourth, same result.  If I close the task, re-open it, and click the button, the data once again is refreshed.... but only once.  Further clicks do not refresh the data.

Any thoughts on why the button will only refresh the data once and subsequent clicks do nothing?

Here's kinda what the SAIL looks like for the button.

    a!buttonArrayLayout(
      buttons: {
        a!buttonWidget(
          label: "Resync Data",
          submit: false,
          saveInto: {
            a!save(
              target: local!refreshResult,
              value: rule!PE_RefreshData(
                identifier: ri!dataIdentifier,
                firstArray: ri!array1
                secondArray: ri!array2
              )
            ),
            a!save(
              target: ri!array1
              value: local!refreshResult.dataArray1
            ),
            a!save(
              target: ri!array2,
              value: local!refreshResult.dataArray2
            )
          }
        )
     }
  )

    Best answer by stefanhelzle0001

    Do you use a local variable inside that expression? If yes, wrap it into a a!refreshVariable call, configured to refresh always.

    Appian tries to be smart and caches the data if the rule input values do not change.

    8 replies

    stefanhelzle0001
    Brainy
    October 31, 2023

    Do you use a local variable inside that expression? If yes, wrap it into a a!refreshVariable call, configured to refresh always.

    Appian tries to be smart and caches the data if the rule input values do not change.

    October 31, 2023

    I think the answer is yes.  I have the local!refreshResult local variable that is only set by the call this button makes to the expression rule which refreshes the data.

    I can try using a!refreshVariable and see what happens.  My other solution (using the term more loosely than I care to) is to use two buttons, idendically configured, and alternately show/hide them.  But, I don't really like doing this.

    stefanhelzle0001
    Brainy
    October 31, 2023

    Yeah, and the button is not the problem ...