Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
I've been trying to use the Add Blog Entry snippet from the platform, but I have an issue.
The snippet inserts in the first line the following line:
var tags = new Array();
If you try to do tags.push, the snippet throws "Wrapped java.lang.Exception: Unable To Convert From org.json.JSONArray to TAGS Cause: Unable To Convert From org.json.JSONArray to TAGS".
I tried the AddTag method, but it does not exist, since it is a new Array.
What is the way to programmatically add a tag to a blog entry in javascript?
Solved! Go to Solution.
Hi Vlad,
To update Tags on a blog entry, you should use UpdateBlogEntry and on tags parameter pass a string with tags separated by ";" something like: "MyVocabulary:MyTag;MyVocabulary:MySecondTag"
You also can create a service which returns the baseType TAGS and set on that service:
var result = "MyVocabulary:MyTag;MyVocabulary:MySecondTag"
To create a new blog entry with tags, you just need to follow my previous instructions but with AddBlogEntry
Hi Carles,
Thanks for the info, I was aware of the way involving strings, but to be more precise, I wanted to know if there's a way to add a Tag using the Array constructor which was provided by the snippet.
I don't think so.
Also you can always do myArray.join(";")