Hi, I'm trying to add contacts to a marketing list using javascript, but I can get the collection/array right.
So this works fine,
var parameters = {
List: {
listid: listGUID,
"@odata.type": "Microsoft.Dynamics.CRM.list"
},
Members: [{
contactid: "3e132973-47b4-eb11-8236-00224814b6e3",
"@odata.type": "Microsoft.Dynamics.CRM.contact"
}]
};
But I want the members array to be built previously, but I just don't know how to do it. I thought I might be able to do this but it doesn't work.
var memberList = '[{contactid: "3e132973-47b4-eb11-8236-00224814b6e3","@odata.type": "Microsoft.Dynamics.CRM.contact"}]'
var parameters = {
List: {
listid: listGUID,
"@odata.type": "Microsoft.Dynamics.CRM.list"
},
Members: memberList
};
So now I'm sure that it's easy to setup, but I just don't know how to do it. Thank you!