How to get the key name in data output?


I get the data like this from WordPress API:
“tags”: {
“School”: {},
“Work”: {},
“Others”: {}
“type”: “post”,
“status”: “publish”,
“password”: “”

How can I get the name of tags (School, Work, Others)?


Hi @yappa,

you should use a Code action and define an input tags and assign {{your-wp-webhook-name.data__tags}}.
Inside Code you can write your javascript code to parse your inputs.tags


Hi CaosMkt: Can you help me to write the code please?

(Daniel Beckett) #4


The variable name isn’t included as an output unfortunately. If you know what data you are expecting then you could use the Text service to replace text from the returned data so that it changes it to a desired value.


Hi @yappa,

create a Code action named Get Tags with this code:

var tags = {{your-wp-webhook-action-name.data__tags}};
var tagName;
var tagsNames = [];
for (tagName in tags) {


Replace your-wp-webhook-action-name with your webhook action name, now you can access the array of your tags with {{get_tags.result}}

Use field NAME (not just value) from previous step in later step?

Hi @CaosMkt

Thanks for this but it didn’t work for me. All I got was a list of numbers from 0 to 171. My “tags” are integers (ids) - maybe that’s why? My tag input looks like this:


Any help would be really appreciated it! Thanks!


Hi @candle, the code returns an array with your keys, it doesn’t matter if numeric or string
I tried it and output result was:


What do you try to do?


Sorry I should have replied, as I figured it out.
I created an input and used that instead of putting the equivalent to this {{your-wp-webhook-action-name.data__tags} directly in the code.

eg., I created an input called “hellotags” and put the value as the equivalent to {{your-wp-webhook-action-name.data__tags}

so my code was:

var tags = inputs.hellotags;
var tagName;
var tagsNames = [];
for (tagName in tags) {


The problem was that for some reason flowxo escaped the quotes in the input, so the input looked like this:


I don’t know why FlowXo did that, but anyway, if I just did what you posted by inserting the value directly into the code without using inputs, it worked just fine


The problem is that inputs are casting to string, in my example i use {{}} notation directly in code so the string in attributes is not escaped and interpreted as a json string.


I found a simpler code so just want to share:

var tags = {{make_a_http_request.data__tags}};
var tagNames = Object.keys(tags)