Dynamic Values for key in API server action key value pair

Hello! I am trying to run a server action that updates an API. I am hoping that both elements of my key value pair can be called dynamically, not just the value. Here is what I am attempting to do:

I have successfully pulled in the dynamic value for both parameter and description_value POST variables. I have tested this by setting cookie values, etc. However, whenever I try to run this API request, it doesn’t work as expected because the key doesn’t resolve dynamically.

Here is the code for the server action:

I am wanting the {{$_POST.parameter}} on line 33 to resolve dynamically. Please let me know if this is possible, or if someone has done it before :wink: Thank you so much!

1 Like

@patrick I was just checking if anything more happened with this :slight_smile:

It is not possible with the current expression parser to have dynamic values as key. The easiest way you could implement it is by creating a custom formatter that creates and returns the object for you.