cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Add tags to a Blog Entry using the Add Blog Entry snippet

VladimirRosu
19-Tanzanite

Add tags to a Blog Entry using the Add Blog Entry snippet

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?

ACCEPTED SOLUTION

Accepted Solutions

I don't think so.

Also you can always do myArray.join(";")

View solution in original post

3 REPLIES 3

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(";")

Announcements


Top Tags