conditionally submit the Interface form using a button in appian

Hi All,

I am facing one challenge to implement one behaviour in appian interface. My interface presents the read only data to the user and user will take action based on his findings by selecting a dropdown value. Finally user hits a "SUBMIT" button whose implemetation is as below. where we call an integration which will update the data and returns an error if an exception found. So my requirement is when user clicks "SUBMIT" button if error occured then form should not submit and close and error message should be displayed. If data updated successfully form should close. I tried below submit condition as well but it didnt work. suggest something.

a!buttonArrayLayout(
buttons: {
a!buttonWidget(
label: "Update",
saveInto: {
rule!PM06_PortalApprove(
tenantId: "77b50320-5f06-5740-84f4-18d4a8cda51d",
identifierId: "s57",
portalTransactionId: property(local!jsonData, "PortalTransactionId", null),
comments: "test",
onSuccess: {
/* Handle successful update */
a!save(local!ErrorMessage, null)
},
onError: {
/* Handle HTTP error */
a!save(local!ErrorMessage, fv!error.message)
}
)
},
submit: if(isnull(local!ErrorMessage),true(),false()),
style: "PRIMARY",
loadingIndicator: true,
validate: true
)
},
align: "END"
)

  Discussion posts and replies are publicly visible

Parents
  • Let's first understand how a submit button works on Appian. 
    When you click on that button and all the conditions are met, then only the button will execute all the various saves. This means that by the time the integration was fired, the button was already clicked so you cannot control submitting the form if you only plan to have a single button and a single click. 

    What you can do instead is to let the form submit itself and call the integration in the process in a script task and use an XOR to check the result of it. 
    If it is an error, route back the process to the same UIT with activity chaining so it looks like nothing happened and if there is no error, continue the normal flow.  

Reply
  • Let's first understand how a submit button works on Appian. 
    When you click on that button and all the conditions are met, then only the button will execute all the various saves. This means that by the time the integration was fired, the button was already clicked so you cannot control submitting the form if you only plan to have a single button and a single click. 

    What you can do instead is to let the form submit itself and call the integration in the process in a script task and use an XOR to check the result of it. 
    If it is an error, route back the process to the same UIT with activity chaining so it looks like nothing happened and if there is no error, continue the normal flow.  

Children