Dismiss Notice
We would like to remind you that we’re updating our login process for all 3CX forums whereby you will be able to login with the same credentials you use for the Partner or Customer Portal. Click here to read more.

Passing results from HTTP Request

Discussion in 'Call Flow Designer' started by David Loke, Sep 30, 2017.

Thread Status:
Not open for further replies.
  1. David Loke

    Joined:
    Sep 30, 2017
    Messages:
    2
    Likes Received:
    0
    Hi,

    I have been trying to pass a result from a HTTP request into a variable in CFD. It is a validating component I'm trying to develop. The result is "1" means validated while "0" is not validated.

    I want to pass this result into a condition where if it is "1" play a success prompt and "0" play invalid prompt.

    I've checked and results are being returned but it is not able to parse into a variable for some reasons. I see an example on MSSQL validation where the "Assign a variable" is used. What i don't understand is the expression in this variable

    GREAT_THAN(validateCustomer.ScalarResult,0)

    May I know what does this do and should I use it if it is a condition that I want to send the variable to?
     
  2. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,677
    Likes Received:
    131
    Hi @David Loke,

    The HTTP Requests component has a property named "ResponseContent", which holds the text returned by the server. So for example, if your component name is "HttpRequest1", then you will get the response using:
    HttpRequest1.ResponseContent

    Also, if you need to check if the response is "1", then you need to use the following expression:
    EQUAL(HttpRequest1.ResponseContent,"1")

    Kind regards.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. David Loke

    Joined:
    Sep 30, 2017
    Messages:
    2
    Likes Received:
    0
    Hi Thanks,

    I got it to work without any build in functions. I also didn’t use set variable component. I simply passed the variable to a condition to do checking instead. All works now.

    Thanks!
     
Thread Status:
Not open for further replies.