Send JSON payload to external service from Appian.

Certified Senior Developer

Hello!

I would like to send JSON payload to external API after the user completes ADD NEW CLIENT form created in Appian.

 

{
  "lastName": "John",
  "firstName": "Smith",
  "birthDate": "1987-04-26",
  "emailAddress": "shogun@go.com",
  "mobilePhone": "+60-11-12345678"
}

So the information provided in this form would be sent externally. I created connected system HTTP and POST integration. I suppose I need to also create a CALL INTEGRATION smart service that would send this payload externally, after adding newly created client to Appian Data Store. Am I correct?

Am I right?  I don't know how to capture in the integration itself the data from a given smart service in a process. So basically now what happens is when I complete the add new client form it triggers the call integration smart service at it sends to external API hardcoded JSON data from below. Do I need to call these process variables from JSON?

Am I going in the right direction or am I entirely wrong? 

  Discussion posts and replies are publicly visible

Parents
  • Yes. You are absolutely on the right path. Now some changed you will have to make is to accept this JSON dynamically. For that, you need to create a dictionary from the data that you just wrote in the DB using 3rd node in your Process. 

    For this, you can add a new script task between the write records and call integration. This script task will accept the record type variable and create a required dictionary for you. Now just wrap the dictionary in a!toJson() and that would give you a JSON that you pass in the integration. 

    NOTE - Use the TEXT type variable to pass the JSON from Script task to PV and then PV to call integration. 

Reply
  • Yes. You are absolutely on the right path. Now some changed you will have to make is to accept this JSON dynamically. For that, you need to create a dictionary from the data that you just wrote in the DB using 3rd node in your Process. 

    For this, you can add a new script task between the write records and call integration. This script task will accept the record type variable and create a required dictionary for you. Now just wrap the dictionary in a!toJson() and that would give you a JSON that you pass in the integration. 

    NOTE - Use the TEXT type variable to pass the JSON from Script task to PV and then PV to call integration. 

Children