Skip to main content

Hi,

I’m trying the following. I have a task that inserts a row in a table ‘input_json’. This task is called as an endpoint, so a supplier can insert some data. The task works, but I have two issues; 

The JSON: 

{
"id": 123456789,
"package-id": "",
"timestamp": 1718105305,
"location": "Rotterdam",
"measurements": {
"dimensions": {
"height": 100.0,
"width": 100.0,
"depth": 100.0},
"weight": 100.00
}
}

My task fails to read the nested values. When I remove the nesting from the JSON and post, it works ok. How can this be mapped accordingly? 

Secondly, the key ‘package-id’ has a score. SF always change my score (-) in the task parameter to a lower score, resulting that the value isn’t saved.

How can these two issues be resolved?

Thanks and kind regards!

Blommetje

Any thoughts on this?


I’m not entirely sure the platform can handle nested JSON structures like this one, but you can always use the method of having one task parmeter that contains all JSON data, and thereafter parse and process it via logic.

Secondly, the key ‘package-id’ has a score. SF always change my score (-) in the task parameter to a lower score, resulting that the value isn’t saved

The platform does not allow - but rather converts that to _, that is the intended behavior. The method above can circumvent that. Maybe other Community members can chime in.


Hi Mark, 

Yes, that would also be a good solution. I've tried this, but so far I've not got the entire JSON data. 
How can I create a parameter that will 'accept’ all data? 

Thanks! 

Blommetje


Hey, 

You could also opt to use a subroutine with API option on. That will make it available via the API through POST as described here: OData API | Thinkwise Documentation (thinkwisesoftware.com)

Have one subroutine parameter called input_data for instance. The caller enters the (escaped) JSON data in this parameter. After that, the subroutine can process the received data.

Hope this helps!


Hi,

I've asked my client to flatten their JSON, so I can process accordingly. I'm surprised nested json isn't supported to be honest. 

Grabbing ALL data in one go could be nice, but also requires the client to adjust their json. Now it was not a big problem, but sometimes it's not possible. 

Are there are plans on supporting this in the future? 

Blommetje