IBM App Connect

Expand all | Collapse all

F lows for API - Building response object dynamically

  • 1.  F lows for API - Building response object dynamically

    Posted 13 days ago
    Hi,

    In flows for API -the GET method, after the Request/Input I have added an "If" branching which connects to SAP or Salesforce based on one of the Input parameters. Since the result from each of the branches is different, how can I combine them to build a common response object? Please refer the image attached.

    Regards,
    Sirisha


    ------------------------------
    Sirisha Sharon Nethala
    ------------------------------


  • 2.  RE: F lows for API - Building response object dynamically

    Posted 12 days ago
    Well I have a hard time understanding your question. From your design document it looks like, per request, you're only ever executing one branch. So if you want a common response object, I would suggest that each branch holds a mapping of the branch's response to that common response object. However, there will be no combining of the responses. For this you would need to execute both branches...

    ------------------------------
    Francois Brandelik
    ------------------------------



  • 3.  RE: F lows for API - Building response object dynamically

    Posted 12 days ago
    Hi Sirisha
    Are you restricted to work with the web based version of App Connect?
    you could call an SAP API which converts the SAP Output into the common response object.
    And a Salesforce API which converts the Salesforce Output into the common response object.
    ( separate flows need to provide these APIs )
    You might also be able to work with something like JSON Parser or XML Parser to transform the SAP/Salesforce Output into common response object.

    ------------------------------
    Matthias Jungbauer
    ------------------------------



  • 4.  RE: F lows for API - Building response object dynamically

    Posted 11 days ago
    Could you tell me how I can insert a an array of objects into Salesforce?
    I tried using JSONata format to specify the index and also used for each loop, but it isn't working.

    I want to create a new record for each of the array object.

    Attached is the API flow and model for reference.



    ------------------------------
    Regards,
    Sirisha Sharon Nethala
    ------------------------------



  • 5.  RE: F lows for API - Building response object dynamically

    Posted 8 days ago
    When configuring any of the actions on the `ForEach` branch, you should be able to map from that specific invoice `Item`.


    ------------------------------
    John Hosie
    ------------------------------



  • 6.  RE: F lows for API - Building response object dynamically

    Posted 8 days ago
    Sirisha,

    The configuration panel for the `if` construct has an  `output schema` section where you can define the common schema for all branches.

    Each branch has an `output data` section where you can define a mapping for that branch onto the common schema. 


    ------------------------------
    John Hosie
    ------------------------------