Condition with variables OR AND not working

Post Reply
PdFUser5000
Member
Posts: 62
Joined: Fri Jun 12, 2020 11:23 am

Condition with variables OR AND not working

Post by PdFUser5000 » Fri Dec 11, 2020 8:48 am

Capture.PNG
Capture.PNG (17.71 KiB) Viewed 1182 times
My files have one of two possible "IDs" in their name and metadata. D-1234567 or VL21-1234. It is always one of them, never both.
I want switch to check if the ID in the metadata is the same as in the filename because the file name is currently created by the user.
When i only check for one of those id-s + email, it works. but when i want to check if either of these id-s is correct + email, the variable does not work.

Should i just create 2 separate connectors for it, or am i approaching the problem wrong? My first guess would be that switch always checks if the name consists of both of those id-s?

freddyp
Advanced member
Posts: 576
Joined: Thu Feb 09, 2012 3:53 pm

Re: Condition with variables OR AND not working

Post by freddyp » Fri Dec 11, 2020 9:06 am

It is a problem of the logic not being correct. You check if the variant of the ID in the metadata is also in the filename and there are two possible variants. This means there is always one variant that will not be equal. So, (A OR B) will always be false. Once you realize this, the solution is obvious.

Disclaimer: as I do not know what is in the right-hand part of the two first conditions the obvious solution may still not work.

PdFUser5000
Member
Posts: 62
Joined: Fri Jun 12, 2020 11:23 am

Re: Condition with variables OR AND not working

Post by PdFUser5000 » Fri Dec 11, 2020 9:43 am

Capture.PNG
Capture.PNG (19.07 KiB) Viewed 1174 times
i think i got it right?
right hand variables are id from metadata

freddyp
Advanced member
Posts: 576
Joined: Thu Feb 09, 2012 3:53 pm

Re: Condition with variables OR AND not working

Post by freddyp » Mon Dec 14, 2020 9:43 am

You have to test for equality instead of inequality:

a part of the filename is equal to something from metadata
OR
another part of the filename is equal to something from metadata

AND

the mail address contains something

PdFUser5000
Member
Posts: 62
Joined: Fri Jun 12, 2020 11:23 am

Re: Condition with variables OR AND not working

Post by PdFUser5000 » Mon Dec 14, 2020 3:01 pm

freddyp wrote:
Mon Dec 14, 2020 9:43 am
You have to test for equality instead of inequality:

a part of the filename is equal to something from metadata
OR
another part of the filename is equal to something from metadata

AND

the mail address contains something
My aim would be to check for inequality, because i want switch to give an error if the data does not match. Is this impossible to do ? My last picture above seems to do the work.

The filename only consists of one of the two identifiers, which in the metadata field is stored in the same path.

The filename is either XXX--D-1234567 or XXX--VL22-7777. The filename is never XXX--D-1234567--VL22-7777

LasseThid
Advanced member
Posts: 336
Joined: Tue Mar 03, 2015 2:30 pm
Location: Molndal, Sweden

Re: Condition with variables OR AND not working

Post by LasseThid » Tue Dec 15, 2020 8:49 am

If you check for equality then the files that are correct will continue that way in the flow.
If you then add a branch for "All other jobs" any file that does not match the conditions set will go thru that branch and you can send your error messsage there.
Attachments
Skärmavbild 2020-12-15 kl. 08.53.21.png
Skärmavbild 2020-12-15 kl. 08.53.21.png (30.46 KiB) Viewed 892 times
Enfocus Switch 2019 Spring Edition, Enfocus PitStop Server 19, Enfocus PDF Review, HP SmartStream 12 & Kodak Prinergy 8.2 with RBA
Offset 72x102, Offset Large Format, Digital Large Format and Digital print.

PdFUser5000
Member
Posts: 62
Joined: Fri Jun 12, 2020 11:23 am

Re: Condition with variables OR AND not working

Post by PdFUser5000 » Tue Dec 15, 2020 12:14 pm

LasseThid wrote:
Tue Dec 15, 2020 8:49 am
If you check for equality then the files that are correct will continue that way in the flow.
If you then add a branch for "All other jobs" any file that does not match the conditions set will go thru that branch and you can send your error messsage there.
missed that option, thanks!

Post Reply