Calling an array of strings in a WebService from a Business Process

Hi community,



For an integration, I have the following JSON request parameter :



{

  "externalID": "57",

  "nomDuClient": "Simple text example",

  "nomDelOpportunite": "Simple text example",

  "calculateurs": [

    "57",

    "61"

  ]


}




Let's have a further look to the "calculateurs" field. When setting the WebService into Creatio with the automatic request paramters, I get something like this :



image.png

I have "Text" data which is an Array. Everything's fine. 



Now, if I use the "WebService" element in the business process, it automatically sets something like this :



image.png



This structure will give a parameter that will look at something like :



"calculateurs": [



{ "name of the element": "value of the first element" }, { "name of the element": "value of the second element" } 



]



Which will be an array of structure of strings and not just an array of string.



Furthermore, when trying to get a collection through looping into a subprocess, the collection of parameters given by the subprocess will look at something like this :



image.png



They will be an array of structure of strings. 



It has been hours that I am trying to populate my WebService parameter as just an array of strings.

How can I achieve that ?



Many thanks,

Jonathan

Like 0

Like

5 comments

Dear Jonathan,

 

Unfortunately, there is no OOB functionality for transferring data sets (IsArray type) to web service parameters by not the 'Read data" element.

 

 We have already registered the idea for our R&D team to implement this functionality in further releases. I will assign your case to this project in order to increase its priority.  

 

Best regards,

Bogdan

Bogdan,

 

I have this situation when setting up the Web Service :

 

When i call the WebService process element, the field automatically fills like this :

 

And with this element, it is impossible to send an array of strings like set in the webservice request parameter isn't it ?

 

If we have a JSON like :

 

"Assistant": [

{

"string": "hello world"

}

]

 

Where the "string" value is set in "Sélectionner la valeur" on the screenshot above. So there is really no way of sending an array of strings, really ?

 

When I test the request directly from the WebService section, I can just add lines to the array and manually setting values into it. Isn't there a way to do it automatically ?

 

Let me ask the question in a different way, how could I send an array of strings via the "Read data" element of the business process ?

 

Many thanks,

Jonathan

Jonathan Quendoz,

 

If the request parameter is a collection (the “Is array” checkbox is selected in the properties of the parameter at the web service record), the nested collection parameters will be displayed under the collection name in the process element parameters (Fig. 3). For example, Creatio “batch query” service can insert several records (e.g. contacts) to Creatio. To do this, the service would require information to write into the fields of each inserted record (e.g. contact names and types). In this case, you can pass the values as a request parameter of an array type, where “Name” and “Type” will be nested parameters and each instance of the collection would represent data for a separate contact record.

 

 

The values of collection parameters of one [ Call web service ] process element can be mapped to the nested parameters of another collection of a [ Read data ] or [ Call web service ] process element.

 

 

 

The parameters of the collection of process elements can be mapped to the process parameter of the “Collection of values” data type.

 

Please refer to the article here.

 

Best regards,

Bogdan

 

Jonathan Quendoz,

Hi! How are you? I'm running on the same problem. Did you find a solution? Appreciate it.

Regards

Uriel Nusenbaum,

 

Hi Uriel ! 

 

Unfortunately, I did not found a solution to this problem. 

I asked to the WebService supplier to adjust their webservice to have an array of structure of strings as json paramater instead of just an array of strings.

 

At the moment, I think that besides calling a WebService via C# in back-end, it is not possible to send an array of strings as parameter. It should really be reworked from Creatio.

 

You can only send an array of a structure of strings via a sequentiel sub-process.

 

Please, if you have any questions about this, do not hesitate.

 

Best regards,

Jonathan

Show all comments