Pergunta

How can I set multiple values in taxonomy field using client model? For single value I use follow snippet:

    var item = ctx
    .get_web()
    .get_lists()
    .getByTitle('News')
    .getItemById($("#newsId").val());

    var newTag = "40;#term_title|cd1df680-fff6-4d37-a336-95a2fbc0719d";

    item.set_item("NewsTag", newTag);
    item.update();

    ctx.executeQueryAsync(function () {
    }); 

it works fine for single value.

I have tried to use newTag variable as array and tryed to concatenate two strings {id};#{title}|{guid} with ; separator but it does not work.

Can anyone help with that?

Foi útil?

Solução

I've found out the right way to set multiple values. Actually the delimiter is combination of semicolon and sharp ";#" not just a semicolon ";"

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top