Customer Portal

HttpConnector not reading from column

Comments 1

  • Avatar
    Tomas Pavlas
    0
    Comment actions Permalink

    Hi Mahmood,
     
    The HTTPConnector can work with dynamic input. However, the Request Content needs to be properly formatted according to the API you are using.


    Let me give you an example using our REST API, specifically for creating a new sandbox.

     
    The DataGenerator generates random codes for the sandboxes to be created. The crucial step is wrapping the input from the DataGenerator into the proper format in the Input Mapping of the HTTPConnector.

    For our REST API, the format must follow the JSON structure, so the Request Content should be:
    {
    "code": "MyNewSandbox"
    }
     
    To achieve creating sandboxes dynamically using the DataGenerator inputs, the formula in HTTPConnector Input Mapping must be as follows to represent proper format of the request:

    function integer transform() {
        $out.0.requestContent = "{ \"code\": \"" + $in.0.sandboxName + "\"}";

    Keep in mind that if you want to include quotation marks inside a string, you need to use a backslash (\) as an escape character. This is necessary because quotation marks have a special meaning - they define the beginning and end of a string. The escape character ensures that the quotation marks are treated as part of the string and not as the end or beginning of the string.


    Best regards, Tom. 

Please sign in to leave a comment.