Forum Stats

  • 3,675,740 Users
  • 4,397 Discussions
  • 3,534 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How to write input JSON data to a String variable/element in OIC

edited August 16 in Social Groups

Hi Team,

I have a rest trigger connection, where I am passing JSON data as an input

Ex:

{

  "OpportunityDetails" : [ {

    "Opportunity_Name" : "Test-240720-01",

    "Account_Name" : "Test Account",

    "Close_Date" : "11/22/2014",

    "Stage" : "Proposal"

  }, {

    "Opportunity_Name" : "Test-240720-02",

    "Account_Name" : "Test Account",

    "Close_Date" : "10/20/2016",

    "Stage" : "Closed Won"

  }]

}

I want to write the entire JSON data to an element

Ex:

<Input>

     <requestData>

     {

       "OpportunityDetails" : [ {

         "Opportunity_Name" : "Test-240720-01",

         "Account_Name" : "Test Account",

         "Close_Date" : "11/22/2014",

         "Stage" : "Proposal"

       }, {

         "Opportunity_Name" : "Test-240720-02",

         "Account_Name" : "Test Account",

         "Close_Date" : "10/20/2016",

         "Stage" : "Closed Won"

       }]

     }

     </requestData>

</Input>

How to achieve this scenario in Oracle Integration Cloud?

Thanks in Advance!!

Thank you,

Jagadeesh Kumar

Best Answer

  • edited July 28 Accepted Answer

    I am able to solve this issue.

    Steps:

    1. After the rest trigger connector, Place Stage Activity - Write Operation with CSV schema with only one column.
    2. Next one more stage activity - Write Operation: Mapping the JSON data coming from REST trigger to JSON schema stage, But check the append to existing file checkbox (file reference same as in Point 1)
    3. Now read the file from the stage by giving the CSV schema - Which returns only one column which holds JSON data. Map this column to a single element/variable

    This is the solution that I tried and that worked for me.

    Thank you,

    Jagadeesh Kumar

Answers

  • edited July 27

    As an Oracle partner feel free to register for our upcoming free OIC virtual hands-on bootcamp www.tinyurl.com/IntegrateSaaS
    Thanks Jürgen Kress

  • edited July 28

    Sure. Already Registered Juergen Kress.

    Thank you,

    Jagadeesh Kumar

  • edited August 16

    Hi @Jagadeesh Kumar Thontapaka

    I have same requirement and I did the same steps as mentioned by you. I am getting error while writing data into CSV file at first step only. Can you please shared me schema files for the same.

    Thanks in advance.

    Regards,

    Bhavesh

Sign In or Register to comment.