Add checkbox check on api

Hello, so here's the situation: in my application, I have a page with multiple checkboxes and the user selects one of them. When they make a selection, I need to patch my API with the label of the checked checkbox. However, I'm not sure how to specify in my JSON body to choose the checked one. Can you help me? I will send you some screenshots along with this message.

My body is this :

And i want the label of checkbox check not the label of checkbox 1, have you an idea ?

Can they check more than one? It looks like from your API example that they can only select one. Then use a Radio Group and its .value will the the selected item.

Otherwise you need to use a transformer that checks every checkbox and if it is checked then append the appropriate properties to an object or add a new object to an array as your API requires. The return value of the transformer will then be the value you put in your API's body.

Let me know if you need assistance implementing that.

1 Like

I have find a solution but thanks for this