IT Process Automation

 View Only
  • 1.  Using createRequest method

    Posted Jun 29, 2018 04:35 PM



    I'm using the createRequest method of Service Desk web service to create a request. I need to pass the web service the attributes and values for the request and also the properties and its values.'


    I created an array with the variables of the process and i set them of the dynamic parameteres.



    The process is returning this:


    The interpreted datatype of the value in value does not match the destination datatype.



    Any suggestions?




  • 2.  Re: Using createRequest method
    Best Answer

    Posted Jul 01, 2018 10:21 PM

    The dynamic parameter expects a string rather than an array.  You can add variables to your 'inline text' either individually, e.g.

    ... in which case you would specify 'parent__', 'base_template__' etc as individual dynamic parameters,

    or as a concatenated string, e.g.

    ... which you would build by concatenating '<string>', label, '</string>', '<string>', value, '</string>', and so on, instead of building an array.  In this case you should probably set the type of the dynamic parameter to 'XML fragment' rather than 'string'.

    Hope that helps.



  • 3.  Re: Using createRequest method

    Posted Jul 05, 2018 08:13 AM

    You can always join your array and store it into Process.SDattrVals :




    var SDattrVals = ["attr1","val1","attr2","val2"];
    Process.SDattrVals = SDattrVals.join("</string><string>");



    Since the starting "<string" and the ending "</string>" are already present in the inline text around "string__", you only need to provide the "<string>" tags that go between the array element, as James explained.