How to pass an array to an api?

I saw your document on array here,

Now, I want to pass all those tags to my api. And since the array is not part of my form. How should I send it to my server action ?

Any solution for this.

What exactly are you trying to do? To just send the values to a server action? If yes - you can store the value in the hidden field in your form and send it.

In hidden field as what type ? I mean the data is an array of texts. How should I store it ?

Hidden field has a type of hidden. What do you need to do with the data exactly - please be more detailed when asking questions.

I have product, it has a unique id. This product has multiple tags. And these tags are stored after the product has been created.

Here is the table structure of tags
id - Unique tag id
product_id
tag_text

The user can select multiple text for a single product. And can upload all those tags at the same time. Which means I have to send an array of tags, like below
[tag1, tag2…].

Now, without creating a product I can store these tags. And I have to pass these tags when a product is created. But since the tags are stored as an array, I am confused on how to pass it to api.

Then what i suggested above is what you need to do. Add a hidden field in your form, use the array component value as a dynamic value for this hidden field and send it to your server action. There, just use the split formatter and split by , to get the array of the values.

It worked, thanks