When a new post is added to my WordPress blog, I want to get it and put it into a Google Sheet I have.
While I have been able to set this up for the most part through Zapier, one issue I'm having is that I can't seem to get the tags for the post.
From googling this, I did see that you could do this by adding this code to a code app
var termsNameArray = input.termsName.split(",");
var termsTaxonomyArray = input.termsTaxonomy.split(",");
for (var i = 0; i < termsNameArray.length; i++) {
if(termsTaxonomyArray[i] !== 'post_tag'){
termsNameArray.splice(i, 1);
}
}
var output = {};
for (var i = 0; i < termsNameArray.length; i++) {
var outputKey = 'tag_' + (i + 1).toString();
output[outputKey] = termsNameArray[i];
}
However, this is from 4 years ago and so when I tried it, it didn't seem to work anymore. Is there another way to do this perhaps potentially using this as a starting point?