Select to view content in your preferred language

Delete all item tags

746
4
09-20-2024 02:14 AM
Labels (1)
JoseManuelPrietoBlázquez
New Contributor

Good morning,
I want to delete all the tags of an item by code like this:

item.update(item_properties={'tags': tags})


I pass an empty string, an empty list, None, [], does not do it.
What element must be passed to achieve it?

Regards

Tags (3)
4 Replies
EarlMedina
Esri Regular Contributor

Use this to clear all tags:

item.update(item_properties={"tags":"", "clearEmptyFields": True})
Clubdebambos
MVP Regular Contributor

Hi @EarlMedina 

This is great thanks, I just wanted to highlight the below as I was giving this a test.

While it removes tags from the Item page as per below...

Clubdebambos_0-1727258217517.png

...there is a lingering empty string in the tags list, so it doesn't fully clear the tags list.

Clubdebambos_1-1727258289938.png

Clubdebambos_2-1727258307411.png

All the best,

Glen

 

 

~ learn.finaldraftmapping.com
0 Kudos
EarlMedina
Esri Regular Contributor

Ah, that's interesting. I wonder why that is??

0 Kudos
Clubdebambos
MVP Regular Contributor

I don't know 😭 you had got me all excited 😂

~ learn.finaldraftmapping.com
0 Kudos