Skip to main content
October 16, 2024
Question

Help with web components

  • October 16, 2024
  • 12 replies
  • 0 views

Hello, 

I'm trying to figure out how to integrate an external web site with Appian. I have a JAVA war file that contains JavaScript files. The war was produced by another organization, and I expect to have occasional updates. I have the war hosted and running on its own server. What I would like to do is push a button on an Appian form that launches the web page created in the war. The user then selects different options in the popup and hits submit. The external web site produces an XML string and sends it back to Appian. Appian then displays the processed XML on the form. Later, when the Appian form is completed and submitted, Appian saves the XML to the DB. 

I've tried using Web Content Field. It displays the button and launches the external web page. I have no idea how to send the XML back to Appian. Web Content Fields don't retrieve data as far as I can tell. I also thought about setting up an Appian Web API for the external site to call and send the data, but I'm not sure how to tell the Web API which form the XML should go to. 

Next, I tried setting up an Appian Integration and Connected System. It seems like the web site has to already be running in order for data to be passed back. Maybe I can try a combination of Web Content field, Integration and Connected system?

I even tried creating my own component plugin but couldn't get the developer token to work and we are unable to provide our production URL and component for inspection to get a production token.  

I appreciate any guidance you can provide. 

12 replies

stefanhelzle0001
October 16, 2024
I also thought about setting up an Appian Web API for the external site to call and send the data, but I'm not sure how to tell the Web API which form the XML should go to. 

This sounds like a reasonable idea. Can you explain what you mean with the following?

tell the Web API which form the XML should go to

An API in Appian can just take any XML you throw at it.

joeys0006Author
October 16, 2024

Thanks for the quick reply. Once the Appian Web API receives the XML string from the external website, how would the XML be displayed on the form that called the external website? As far as I know, the Appian form does not have an id that can be sent to the external website. The form receives an id for the DB when the user submits the Appian form, but that would be too late to show the XML on the form. We'll have multiple users working on the Appian app concurrently and we'll have to send the correct XML to correct user and form.

stefanhelzle0001
October 16, 2024

I am not sure I fully understand this user interaction. Can you help me out?

In that web component, you call some URL that could include a unique identifier as a parameter.

October 17, 2024
The following might be helpful:
  1. Create a link in Appian form to open the external page in a new tab. Pass some ID(ex. correlation_id, ) as a URL parameter.
  2. Once the user enters the required details and submits data in the external site, call Appian Web API to submit data(XML) back to Appian along with the ID passed in Step 1.
  3. Show the received XML to the user in Appian. Use the ID sent in step 1 for mapping request/response
joeys0006Author
October 17, 2024

I'm having a hard time understanding how step 3 would work. How does the Web API use the unique id to find the form that started the external site? Would the Web API invoke a Smart Service or Process Model? Does it save the XML to the DB and somehow the form gets refreshed to pull in the updated DB?  I'm very new to Appian and I've been using this Creating Web APIs - Appian 24.3 (and the other Web API tabs) to try and understand Web APIs. Are there any examples I can look at?

vimals
October 31, 2024

Hi joeys0006,

As Yogi mentioned, you can generate an instance id(Eg:12045) of the form that is rendered and send that to the external site by passing it as an URL Parameter.

Based on your response, it seems like you can do step 1 and 2.

You can do step 3 by, one of the below

Option 1: Using Local Variables Refresh:

Have a local variable which will refresh in appian for every 30 seconds, this local variable value should call the query to pull the data pushed to Appian using Step 2.

Option 2: Using Refresh Icon:

Have an Icon/button within the page, which upon clicked should call the query to pull the data pushed to Appian using Step 2. if value is returned you can update your interface as you want or else you can continue to show the refresh and wait for results.

mathieud0001
October 19, 2024

This seems like a lot of trouble just to save on the development (and potential changes) of a form.

Have you considered replicating the form on your end, submit via API and display the response?

joeys0006Author
October 21, 2024

Unfortunately, the tool we're trying to integrate with is not a simple form. The tool has complicated logic/rules (that can change in new releases) and generates an XML string used by other apps for outgoing messages. The customer developed this tool, and it is used in other apps which allows for some consistency between their apps. We created a watered-down version as a temporary measure and it's causing additional issues. 

joeys0006Author
October 30, 2024

I found this site in the Appian documentation that states:

"Instead of using a Document Download Link, you can configure a Web API in Appian which returns a document, either as an attachment or inline, and then call this Web API using a Safe Link. This will let users view, in the browser, any documents that the browser can render, rather than automatically downloading them."

We're using Sites for our user interfacing forms. How does Safe Link display the document? Can Appian display an XML string? Can the doc be saved to the DB?  Safe Link doesn't have a save option as far as I can tell. 

stefanhelzle0001
October 30, 2024

This does not work in sites.

Appian can display a XML string.