5

Create MS SharePoint List Item from C4C using CPI iFlow

 2 years ago
source link: https://blogs.sap.com/2022/04/14/create-ms-sharepoint-list-item-from-c4c-using-cpi-iflow/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Introduction

As part of this blog , we will go through a scenario of posting a new Item on a SharePoint Site List with data being provided from C4C Service Ticket , using SAP CPI iFlow .

Our%20Scenario

Our Scenario

Prerequisites

  • Your MS Admin should create an App for CPI with necessary API permissions  and provide you with ClientID and Client Secret # .
  • You have tested the API successfully using Postman
  • You should have access permission to the endpoint (Sharepoint List )

*The scenario includes some PDI /SDK in C4C , as well as some UI Modifications (to create the action that triggers our iFlow in CPI and send the SOAP message with Ticket information) , However ,in this blog the focus is on the CPI iFlow settings .

Steps

  • Create new wsdl file for the SDK Action in C4C

You should create a new WSDL file with all the required elements required from C4C Ticket .

You can base your new wsdl on any existing wsdl you use for other iFlows from C4C and make adjustments as required .

WSDL.png

  • CPI : ‘OAuth2 Client Credentials’ setup

For our connection to SharePoint Graph API , we are going to use ‘OAuth2 Client Credentials’ .We would need to setup a new OAuth2 Credentials under Overview >Security Material with following information :

Name {{Credentials_Name}}

Grant Type Client Credentials

Description {{Description}}

Token Service URL https://login.microsoftonline.com/{{SiteID}}/oauth2/v2.0/token

Client ID {{ClientID}

Client Secret {{ClientSecret}}

Client Authentication Send as Request Header

Include Scope Check Checkbox

Scope https://graph.microsoft.com/.default

Content Type application/x-www-form-urlencoded

By the end it should like that :

OAuth2-Credential.png

SecurityMaterial.png

  • Create new iFlow that will Map ,Convert and Post the new SharePoint List Item

Now we are at the point of new iFlow creation/configuration (based on the business scenario requirements) .

CPI-_IFlow_View.png

Sender connection configuration : C4C -(SOAP )

Sender_SOAP-1.png

Receiver connection configuration : SharePoint -(HTTP )

Receiver_HTTP.png

You will need the following information:

Address https://graph.microsoft.com/v1.0/sites/{{SiteID}}/lists/{{ListID}}/items

Query

Proxy Type Internet

Method POST

Authentication OAuth2 Client Credentials

Credential Name {{YourCredentialsName}}

Timeout (in ms) 60000

Throw Exception On Failure Check Checkbox

Request Headers

content-type = application/json

Response Headers

*

XML to JSON Converter step : 

our XML to JSON step will have the following configuration . It is important , as the MS Graph API supports JSON  and not XML :

XMLToJSONConverter.png

Use Namespace Mapping : Checked

JSON Prefix Separator : Colon(:)
JSON Output Encoding : UTF-8

Mapping step : 

Based on your business requirements , you use the Mapping step to fulfill those requirements (i.e.: adding default fields to the POST which are not coming from Sender , Any other specific logic for the fields ) .

You will have to create a new XSD file with all the WSDL elements and than create the mapping schema as usual .

  • Create new Communication Arrangement in C4C for the iFlow

At this point , the iFlow can be tested using tools like SOAP UI  .

As a final step on our scenario , we will configure a new Communication Arrangement in C4C (the scenario should be available once the SDK/PDI step is completed ) .

We will just create the new Outbound comm.arrangement and connect to our iFlow Service URL as example below :

Communication_Arrangement.png

  • Result in SharePoint List

Once we get to this point , according the requirement , Users will be able to trigger our iFlow and send over the C4C Ticket details to a specific SharePoint Site List :

Sharepoint-List-Item-from-C4C-1-2.png

Summary and Additional information sources:

The above is just an example of how we can utilize the MS Graph API in CPI to help the business achieve seamless integration between any system and the SharePoint Sites and Lists .

There are many business scenarios which this same method can be utilized .

I certainly hope you will find this information useful .

As an additional resource of info regarding the MS Graph API capabilities :

Microsoft Graph API Documentation 

If you find this blog helpful , please Like ,Follow and Share it .

You are also welcome to comment and ask any related questions below .


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK