Page 1 of 1

Condition with variables OR AND not working

Posted: Fri Dec 11, 2020 8:48 am
by PdFUser5000
Capture.PNG
Capture.PNG (17.71 KiB) Viewed 5714 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?

Re: Condition with variables OR AND not working

Posted: Fri Dec 11, 2020 9:06 am
by freddyp
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.

Re: Condition with variables OR AND not working

Posted: Fri Dec 11, 2020 9:43 am
by PdFUser5000
Capture.PNG
Capture.PNG (19.07 KiB) Viewed 5706 times
i think i got it right?
right hand variables are id from metadata

Re: Condition with variables OR AND not working

Posted: Mon Dec 14, 2020 9:43 am
by freddyp
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

Re: Condition with variables OR AND not working

Posted: Mon Dec 14, 2020 3:01 pm
by PdFUser5000
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

Re: Condition with variables OR AND not working

Posted: Tue Dec 15, 2020 8:49 am
by LasseThid
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.

Re: Condition with variables OR AND not working

Posted: Tue Dec 15, 2020 12:14 pm
by PdFUser5000
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!