Few things…
This option on the plugin builder ‘fields’ section just popped up for me the other day. I’ve been using the plugin builder for about 8 months now. I though this was a new feature so went to the forums to read about it and it apparently has been around since 2019. Is there a reason I wouldn’t have seen this option until now?
Now for the bigger issue. Using this feature I’d assume it would return an array as
[
{key_name : value_name}
]
but it doesn’t. Its outputting:
[
{key: key_name, value: value_name}
]
which gets interpreted as ‘key’ & ‘value’ are the keys, and then ‘key_name’ & ‘value_name’ are the values.
Next if you add more than one key:value pair it puts each one into its own object within the array…
[
{key1: key1, value1: value1}
{key2: key2, value2: value2}
]
Now thats not that big of a deal but typically if you are given more than one key:value pair it typically goes into one object, right? Which leads to the next problem. If you try to do lists with this here is what it outputs…
Which now you can’t guarantee the correct quantity with the correct price (at least for this example) which limits this entire feature to only accepting one thing. Kind of becomes useless at that point.
Am I doing something wrong here, or is this normal behavior? and has anyone used this feature successfully?
Last, as the plugin developer shouldn’t we be specifying what the ‘keys’ are? Not the person using the plugin because they don’t know what keys to enter unless we tell them. We already get to specify what fields show, why not the keys?
Also, quick side note, does console.log() not work? can’t get anything to print to the console.