Feature Request

I don’t think there is a way to do this without deconstruction and reconstruction using a Type Converter, but it would be nice to be able to modify an abject by either updating a member or adding a new member. Also, if the member is an array being able to append to it.

this would also be nice if it was available as the new cloud plugins :wink:

3 Likes

@brandon_mcclure You can modify objects with the JSON Edit plugin. It can update a value and delete a key currently. We can add a new action to add a new key.

1 Like

Thanks, let me try that

1 Like

Also, Type Converter got “combine arrays” recently, which might check off your second request here.

1 Like

Combine arrays is working as expected, but not to update the JSON. I guess I don’t really understand the JSON templating though because I’m still recreating the object and I could just do that with the string to object plugin? Also, it creates a new object needing a new name, I was hoping for an object that would get initiated at the top of the workflow and possibly modified as Decisions and Loops occur, but his may be outside the scope of how a Workflow works and a storage object might be a better option.


Also, the documentation for the JSON has incorrect capitalization for the extraction, I was using this to test and couldn’t figure out why if wasn’t working until I saw this.

The extraction line:
{"name":"$0", "characters":["$1"], "age":{"eons":"$2"}}
Should be:
{"Name":"$0", "Characters":["$1"], "Age":{"eons":"$2"}}
To match the instance:
{"Age":{"eons":8}, "Name":"SnowCrash", "Characters":["Hiro Protagonist","Y.T."]}

1 Like

Are you using the JSON plugin or the JSON Edit plugin? We’re sunsetting the JSON plugin.

We shipped a new action to the JSON Edit plugin today to add a key / value to an object.

Yes that worked (I was using the old plugin) and I was able to append to an array using the Type converter action, but one thing I found was that I had to use the Type Converter Action of String to Object still if I wanted to pipe one JSON Edit to another one because I needed to update two fields and calling the [0] of the output of the first for an input failed as an invalid JSON. This also required new names for each Object so a simple Workflow to change the name of an object and append an attribute consisted of 11 steps and had step names of Object, Updated Object, Updated Object to Object, New Updated Object, and New Updated Object to Object. I can send an icon file of this workflow as an example.
For a large Object this would make sense, but for a small one I could do all of this in two steps using the String to Object action and some fancy handlebars. I do like it though, and it does work better than the old one and I probably will use it on large objects.