Welcome Guest

Pages: 1
Delete UDTI tag values
Gary-SwiftPostDecember 31, 2022, 08:45
Newbie
Posts: 10
Registered:
April 29, 2014, 06:12
Normal topicDelete UDTI tag values

I want to clear specific UDTI tags if a value is set. I have created the action where I can clear multiple Field tags.

However I am unable to to the same for UDTI fields.

I have unsuccessfully tried setting the tag as a named variable.

Can anyone offer some advice for this?
Image

Gary-SwiftPostDecember 31, 2022, 08:50
Newbie
Posts: 10
Registered:
April 29, 2014, 06:12
Normal topicDelete UDTI tag values

I would also like to delete some of the UDTI tags completely (as opposed to clearing the value).

Gary-SwiftPostDecember 31, 2022, 10:56
Newbie
Posts: 10
Registered:
April 29, 2014, 06:12
Normal topicDelete UDTI tag values

I would also like to delete some of the UDTI tags completely (as opposed to clearing the value).

I have found the way to this.

I added the action 'User Defined Fields' using the following settings.

Remove all User Defined Text Items with case insensitive name 'PMEDIA' (set state all)

I would still like to know how to do a conditional test with this.

For example, this is how I clear the comment field:

Test if the Comments field is equal to 'PMEDIA' (Set result)
if true
	Clear the Comments field
endif
2MR2PostJanuary 8, 2023, 10:25
Avatar photo
Administrator
Posts: 1891
Registered:
August 23, 2012, 19:27
Normal topicDelete UDTI tag values

Sorry for the long delay. Somehow I did not receive a notification.

Here's a snippet to test if PMEDIA contains 5 and to remove it if it does:

1: Test if text "\^PMEDIA^" is equal to "5" (Set test state)
2: if true
3: Remove User Defined Text Item 'PMEDIA'
4: endif

Statement 1 is a Compare Text statement with the source set as Text. An escape sequence is used to load the value of UDTI PMEDIA. See the attached screenshot.

Statement 3 is a Set User Defined Item statement. When setting a UDTI to empty it is removed.

Note that this snippet and the one you used for COmmenst is only valid one a single file at a time due to the test logic. The following snippet would work on all selected files at once:

1: Test if text "\^PMEDIA^" is equal to "5" (Set test state and Variable 0)
2: Ignore files where Variable 0 is false
3: if true
4: Remove User Defined Text Item 'PMEDIA'
5: Restore Initial Set of Files
6: endif

Statement saves the result of the test on each file to track variable 0.

Statement 2 ignores files where variable 0 is false. ie. PMEDIA is not 5.

The contents of the If on statement 3 is only executed if statement 2 resulted in at least one file still being active. Statement 5 restores the initial set of files.

Hopefully this helps. Again, sorry for the delay.

Image

Gary-SwiftPostJanuary 15, 2023, 14:22
Newbie
Posts: 10
Registered:
April 29, 2014, 06:12
Normal topicDelete UDTI tag values

That's great, thank you very much 😀

Pages: 1
Mingle Forum by Cartpauj | Version: 1.1.0beta | Page loaded in: 0.024 seconds.