How to write data into metadata?

I have some custom taxonomies in my woocommerce store.

When I try to add items in metadata, only the first id received.

The map() function only read data, not write.

I can hardly find relevant information about the metadata functions. Can anyone help with this? Thanks ahead!

Hello @lazyarchi and welcome!

Assuming you have a collection of items to add to Meta Data, you would use an aggregator (in this case, maybe a JSON Aggregate to JSON module) to build a collection of the items you want to add, then use the output of that as the input to Meta Data in your WooCommerce Update a Product module.
You would need to toggle on the “Map” next to Meta Data shown in your screenshot to use the output bundle from the JSON module.
I would show you an example, but I don’t have a WooCommerce account so I’ll search around for something similar.

3 Likes

I did something similar. If you want to use the Map toggle on a field that expects an array, you just need to pass it an array.

To pass it in the correct format, simply use an array aggregator in the previous step, AND you need to select the format in a future module here:

I couldn’t make screenshots for Woocommerce because I don’t have access to one, but the concept should be quite similar, unless the Woocommerce App module’s interface wasn’t specified (then the aggregator doesn’t know what fields it needs to show for the Target structure type).

Once I selected the “Discord - Send a Message: Embeds” structure, below automatically displays the relevant Embeds fields (title, type, etc.), which I then was able to map variables to the fields. This allowed me to pass more than one Embed item.

I was getting a list of current freebie game promotions from Epic Games, and then sending them to my discord server:

2 Likes