Integrate SAP Build Apps and SAP Build Process Automation using SAP BTP Destinations
In this blog post, I will show you how to trigger the Business Process of SAP Build Process Automation in SAP Build Apps.
Below is the sequence of the steps to be followed.
1. Create a destination in SAP BTP Cockpit
2. Create an API Trigger for Business Process in SAP Build Process Automation
3. Configure the BTP Destination in SAP Build Apps.
4. Test the Destination Configuration in SAP Build Apps.
Create a destination in the SAP BTP Cockpit
1. Create a Destination to connect SAP Build Process Automation with SAP Build Apps.
Enter the value under the URL. This is the API call to trigger your Business Process.
Change the authentication to OAuth2ClientCredentials, Client ID, Client Secret, and Token Service URL can be retrieved from the SAP Build Process Automation Instance from your tenant.
Add these Additional Properties for this destination to work in SAP Build Apps.
Create an API Trigger for Business Process in SAP Build Process Automation
Prepare your Business Process by creating an API trigger and configuring the input parameters to integrate with SAP Build Apps.
Refer to the blog post on How to create an API Trigger.
Configure the BTP Destination in SAP Build Apps.
Follow the documentation to Enable BTP Authentication in your app,
.We have successfully created a destination in BTP and created an API trigger for Business Process in SAP Build Process Automation. Let’s configure the destination in SAP Build Apps.
1. Click on CREATE DATA ENTITY and select SAP BTP destination REST API integration.
3. As the BTP destination name, select AppGyver_SPA.(Destination which was created BTP Cockpit)
4. Under the Data resource name, a name can be given to this data connection, like “SendtoSPA”.
5. Under Resource schema, click on + ADD NEW to create a schema. Name the new schema “filename” and select the Field type as Text. Choose ADD.
Schema is the structure of the data. A schema is created which is similar to the Database. In this scenario, and schema should be created matching the schema of your API trigger in SAP Build Process Automation.
6. Similarly, add three other schemas with the following names:
Select the Field type for all of them as Text.
7. Select the create tab, and enable it.
8. Open the binding menu for Request headers by clicking on the X icon.
10. Click on Add value, and enter the following values:
Header name: Content-Type
Header value: application/json
Click on SAVE.
12. Open the formula editor. Enter the following formula:
Your Definition ID was copied from SAP Build Process Automation. Refer to the blog post to get the definitionId of your Business Process.
13. Click on SAVE.
Test the Destination Configuration in SAP Build Apps
You can test if this Data connection is working.
Switch to the TEST tab and enter the below values in the following fields to test the connection:
Click on RUN TEST.
Scroll down and check the Status of the Response.
If you are getting any errors please recheck the above steps. If you get the response as Status: OK, then the connection is successful.
Select SAVE DATA RESOURCE.
You can successfully link this data source to any UI element like Button in Build Apps!
Thanks Chaitanya Priya Puvvada for this excellent blog. Awesome and comprehensive summary!
Im really excited to get this going but I'm failing to connect when creating a Destination in BTP. I get a 401 unauthorised message when i click the check connection button. The only thing different I see is that the AppgyverEnabled property is missing from the list. Could this be the issue or am I missing something from the Set Up? I used the booster to set everything up.
Can you please share the details of the destination that you have created mainly the token URL and API URL that you used while creating the destination?
Hope you have added /oauth/token to your authentication URL to form Token URL
Hello Chaitanya Priya Puvvada ,
Thank you for excellent blog. I have issue to connect when creating a Destination in BTP. I get a 401 unauthorized message when i click the check connection button. All process is working on postman. Do you have any idea?
You can ignore that 401 message.Few a times ,even though credentials are correct it throws an error.If your credentials are working fine in postman and if the same is maintained in destination you can ignore the message.
We created a detailed tutorial on this.
Hi Chaitanya Priya Puvvada
This is an excellent blog, I followed exactly the same steps to trigger API from Build Apps to the Process Automation . But getting 404 error while testing the integration of API trigger from Build Apps to Process Automation
Please suggest the reason for the error and solution.
Note the Destination to SPA icheck connection is working fine. But getting 401 error message. But that can be ignored as you have suggested and from Postman to Process Automation API trigger is working fine
Hi, I have the same issue here, did you find the solution ?
Hi Chaitanya Priya Puvvada ,
any updates here? I am also the same issue as Karnamuhil Krishnan and Francois HARDY . In Postman everything is working fine, but as response for the destination check on BTP and the trigger test in SAP Build apps I get a 401 Therefore I am a bit stuck here.
Hello Francois HARDY Raphael Witte ,
Can you re-create the destination and double-check if you have entered the correct credentials?
Hello Chaitanya Priya Puvvada ,
my problem has already resolved itself after just waiting one day and trying again. Maybe just a hickup somewhere. Nevertheless thanks for the response!
Chaitanya Priya Puvvada : Is there a way to achieve this functionality without enabling BTP destination? We are working on an app that scans barcodes and hence has to be used with a mobile preview only. However, BTP destination currently does not work with mobile preview. So, in such cases how do we call a process automation from SAP build apps?
Hi, We are currently working with mobile btp authentication.
In the meanwhile, however, if your api is normally accessible you can create the integration via classic data entities. Just do not use the BTP connection, but the normal one with direct url to the api of yours.
Pekka Turtola : Thanks for your reply!
We managed to accomplish this, but wasn't easy though :-). I am leaving the reference to a fantastic blog that we referred to. This is just a workaround until the mobile BTP authentication is working and can help anyone who faces the same issue as us.
How-to: Combine SAP Build Process Automation with SAP Build Apps – Version 1 | SAP Blogs