Call JavaScript in a button interface

Hello

Hello.
I have a requirement in which I need to make an AJAX call using JavaScript in a button, does anyone knows if this is possible?

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    You can have a button submit a form, and after submit send process flow to a node that calls a webservice or plugin.  Your webservice could contain potentially any code you want, including an AJAX call, and your plugin would be Java, which can do theoretically anything Java can do.

    If you're attempting to make AJAX make the Appian screen instantly refresh, I don't know how that will work.  You could probably change some local variables and set the form to reevaluate the instant that happens with the new a!localVariables from 19.2.

    You also might be able to call a custom rule built from a plugin inside the saveInto block of a button that's not configured to submit.

    It all depends on your specific use case.

  • It would be helpful to know what you want to achieve using an AJAX call. It's not possible to directly use JavaScript in a button (or in an Appian SAIL form), but there are a lot of ways to set up dynamic behavior using SAIL (or possibly plugins). Can you provide some background on what you're trying to achieve?

  • So as a few of the replies have said so far, you cannot execute javascript from a button, however, dependent on your use case, Appian now has the ability to have AJAX style functionality within forms using auto refreshing interfaces - have a look at that. There are some limitations, but it does make interface design a lot more interactive and responsive.

    Hope that helps!