Yes I was just coming back to provide this.
OK so… thanks? But also meh?
I mean, yes it is a fix for now, but it’s sort of magical handwaving isn’t it? Pulling a coin out of your ear. Why should a script have to duplicate the listing’s map, change that, and then replace the original with the new one?
BTW, the same trick also works fine with the JS I provided. The problem is not the syntax I used, but rather that the User Properties map does not have a working setter in the app. In other words, you cannot set a particular user property, you can only replace the entire user properties map.
later
This minor improvement of my older code also works:
function run(){
var these = selectedListings;
let targetKey = "CBLOCATION";
let newValue = "BK01";
these.forEach((listing) => {
var updatedProperties = listing.userProperties;
updatedProperties[targetKey] = newValue;
listing.userProperties = updatedProperties;
consoleLog(listing.title + " : " + listing.userProperties[targetKey]);
});
}