Passing NULL through the connector input parameters – Issue

  • Ishant
    Participant
      Has successfully completed the online course Basics (100)
    3 years, 10 months ago #27721

    Hi,

     

    We are having issue at the connector input parameters. Right now, we are not able to pass Null as the input parameters in the connector call, it is throwing error. There are many scenarios in which we have to set our parameters to Null .

     

    Like, if we want to insert employee information in a table. There might be a scenario in which  we only want to insert specific details of that employee not all the details are mandatory.

     

    Our employee object would be like :-

    var employee = {

    name: ‘Ishant’,

    email: ‘ishant@xyz.com’,

    company: ‘xyz’,

    age: null,

    qualification: null,

    };

     

    SQL Query: –

    INSERT into employee (name , email ,company , age , qualification) VALUES ( :name: , :email: , :company: , :age: , :qualification: );

     

    So right now, if we pass this object in a connector input parameter then access it in the above mentioned SQL query, it is throwing error.  (Most probably due to keys of object is set to NULL ).

     

    And also, we don’t want to make separate connector calls to insert specific information rather than that we want to achieve this in a single connector call.

    So, how can we achieve this ?

     

    Hoping for a positive reply

     

    Thanks and Regards,

    Ishant Kushwaha

    Christian Kleinschroth
    Moderator
      Has successfully completed the online course Introduction
      Has successfully completed the online course Intermediate (200)
      Has successfully completed the online course Advanced (300)
      Has successfully completed the online course Basics (100)
      Has successfully completed the online course Advanced (310)
      Has successfully completed the online course Advanced (320)
      Has successfully completed the Intermediate Certification
      Has successfully completed the Advanced Certification
    3 years, 9 months ago #27792
    Up
    0
    Down
    ::

    Hi Ishant,

    in case, your database has no (other) default values set for ‘age’ and ‘qualification’, you get null values for ‘age’ and ‘qualification’, by specifying them as optional Connector input parameters. Then, you can call the Connector with

    var employee = {
    name: ‘ashutosh’,
    email: ‘ashutosh@xyz.com’,
    company: ‘xyz’
    };

    and get null values for the not specified (optional) input parameters.

    Best regards,

    Marie

    3 years, 8 months ago #28954
    Up
    0
    Down
    ::

    I have also reported this issue a while ago.

    The input validation of a connector can’t handle null values as you would expect. The only work around is to delete all null-fields, like Marie explained.

    I hope that there will be better solutions in the future.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.