JXA Sometimes Importing to Wrong Location

Wow. Things can be so simple.
:+1: :clap: :champagne: :fireworks:

Wow that’s very interesting - thank you - it has been quite a mystery and now the reason is clear.

I do indeed very intentionally tag groups regularly.

If I comment out the line to import tags, it does indeed work as intended in all databases.

I think we will change the API code so if no tags are assigned then that line of code is simply not run so the tags will remain however they are rather than explicitly being assigned a null value.

Thanks!

You could also merge the already existing tags of the record (due to groups not being excluded from tagging) with the desired tags and then set the merged tags.

yes that is probably better - thanks

something like this, I think:

rec.tags = rec.tags().push(...myTags);

1 Like

Or, as an alternative to the .push, perhaps:

rec.tags = [...rec.tags(), ...myTags];

1 Like