Problem with datetype in webservice and business process

I am connecting a third-party API to Creatio, it delivers different types of data including this:
"user_id": [
60,
"Luismary Mendez"
]
In the parameters of the Creatio response I have set it as an Array Text and as an Object

 

But when I try to connect this variable to the process it does not display it in the list of possible result values.

The field is Vendedor:

Like 0

Like

5 comments

This is because the user_id is an array in the payload received from the web service, not just a single value. If you know the array will only contain a single set of values and the first value in the user_id array will always be the integer Id and the second value will always be the text name, you could flatten them out by mapping them as text and integer values:

  • Map ID as: user_id[0]
  • Map Name as: user_id[1]

Ryan

Ryan Farley,

What you're telling me is that I have to set the user_id as an object?

You could, but that doesn't pass to a subprocess (with an array inside an array). If you are able to flatten it out and if you know the array will only contain a single set of values and the first value in the user_id array will always be the integer Id and the second value will always be the text name, that will pass easily to a subprocess. Like this for the "user_id" first element in array, which is an int from what you've shared:

The second value in the user_id array, which is a string from what you've shared, would look like this:

This is assuming your JSON looks like this:

{
	"result": [
		{
			"id": "someid",
			"name": "somename",
			"user_id": [
				60,
				"Some name"
			]
		}
	]
}

You're basically changing it from an array with an int in index 0 and string in index 1 to flattened out properties pointing to the value in index 0 and index 1. This is, of course, assuming that the user_id array will only contain an int at index 0 and a string at index 1.

Ryan

Ryan Farley,

Thanks Ryan, I understood your explanation, I will apply it and let you know how it goes.

Carlos Soto,

Thanks Ryan. It's works

Show all comments