Note Attributes (Array) -> Add Collection Item (Name/Value Pair)

I know this has been asked a thousand times. I just can’t seem to apply the concepts explain in the other posts.

What I am trying to build is simple:

  1. I have a webhook that looks to see if something changes on a Shopify order
  2. If that happens I need to grab the Note Attributes parameter (see image below) and add name/value pair to the existing name/value pairs (I don’t want to replace the existing data, I want to add to it)

Screenshot 2024-02-22 at 9.18.52 AM

My question:

  1. How do I create a new collection of name/value pairs and add it to the existing Note Attributes array. I know how to do the API PUT request, but I do not know how to create the array. The image below is an example of what I want the end result to be (existing “1” collection plus new “2” collection).

Screenshot 2024-02-22 at 9.30.25 AM

Welcome to the Make community!

See How to create a key-value object/collection, and add to an associative array containing key-value pairs - #5 by samliew

Give it a go and let us know if you have any issues!

2 Likes

@samliew Thank you for the fast reply! I believe that worked for me!

However, I think maybe now I don’t know how to do the correct PUT request with this new data.

As you can see in the screenshot below I was able to add a new item to Notes Attributes.

This is the error I am receiving now in my PUT request:

{"error":"Bad Request","message":"The server has refused to accept the request because the payload format is in an unsupported format"}

Here’s what the module looks like. Any recommendations?

That’s because you used Parse JSON to convert it into a make collection, so it is no longer a JSON string.

What modules do you think you can use to convert it back into a JSON?

2 Likes