Summary:
This article describes the step-by-step process of creating a FlowService in webMethods.io Integration New Flow Editor for the data sync between Coupa and Servicenow “Inventory”.
Prerequisites:
- User needs to have a working Coupa account, to log into the Coupa tenant
- User needs to have a working Servicenow account, to log into the ServiceNow tenant
- Access permission for Coupa APIs and Servicenow APIs
- Working webMethods.io tenant
Steps to create flowservice for Coupa and Servicenow “Inventory” in webMethods.io:
1. Login to webMethods.io integration
2. Click on Project and navigate to FlowServices
3. Create a flowservice and provide a name.
4. Start typing try and select Try...Catch... from dropdown options.
5. To add a comment click on the dots on the right side of the control and select “Comment“ from the dropdown.
6. Start typing transform and select Transform Pipeline from dropdown
7. Add “getCurrentDateString“ and map to “startDateTime“ and “endDateTime“.
8. Add “incrementDate“ and map I/O as below:
startDatePattern: yyyy-MM-dd'T'HH:mm:ss'Z'
endDatePattern: yyyy-MM-dd'T'HH:mm:ss'Z'
addDaye: -60
9. Add Coupa connector and add custom operation.
Create Coupa account by providing all the details.
Fill in other details:
Select “Query“
Select “inventory_transactions“
Select all the fields:
Review details and click on done.
Add input query filter as below:
10. Add if-else
If condition queryInventoryTransactionsOutput is not null
11. Select “ ServiceNow Enterprise Service Management“ connector and create custom operation “ createReceivingSlip“.
Fill in the details to create account:
Select “Insert Record“ in Operation.
Select “proc_rec_slip“
Select all the fields:
Review selection and click on Done.
Map as below:
Hardcode “stockroom“ to “San Diego Border - Pickup/Dropoff“
Hardcode “purchase_order“ to “PO0010788“
12. Add repeat on “inventory_transaction“
13. Follow steps similar to step 11 to create “createReceivingSlipLineItem“ operation for servicenow connector with Business object “ proc_rec_slip_item“.
Map fields as below:
14. Add “logCustomMessage“ in else and “getLastError“ in Catch block
15. Run the service and expect results similar to below image