Welcome Guest

Pages: 1
Problem with "Exists Test" with "if-endif" updates
famausPostFebruary 18, 2017, 13:37
Newbie
Posts: 2
Registered:
February 18, 2017, 18:15
Normal topicProblem with "Exists Test" with "if-endif" updates

Hi,

I have created below action:

Exists Test - If "Year" field does not exist (set results)
if true - "Set" the "Year" field to "2017"
endif

Now, if I select multiple items with few items having empty/blank "Year" and run above Action then the "Year" for all of the selected items the value gets updated to "2017".

Shouldn't the update happen only to the entries where "Year" was empty/blank?

Thanks!

Image

2MR2PostFebruary 18, 2017, 15:51
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicRe: Problem with "Exists Test" with "if-endif" updates

This is the nature of the parallelism of stepwise mode. The result of the test will be true if at least one field matches the desired condition. In this case the result is true. The IF then executes and you execute the Set statement for all files.

You have to execute the code groupwise, typically by calling a sub action or by placing a Force Grouped Execution statement at the start of the action.

Alternately you can do:

Set Variable 1 to "2017"
Copy the Variable 1 field to the Year field only if empty

The Set statement operates on every file setting Variable 1 to "2017". It then operates on every file copying the Variable 1 field to the Year field, if it is not empty.

famausPostFebruary 19, 2017, 20:10
Newbie
Posts: 2
Registered:
February 18, 2017, 18:15
Normal topicRe: Problem with "Exists Test" with "if-endif" updates

Thanks for the tip. I replaced my action with "Set" & "Copy" and it worked.

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