Formula dosn’t work

:bullseye: What is your goal?

I’m taking PDF attachments from Outlook, extracting data from the invoices using PDF.co, then normalizing the company name with a Set Variable module — removing extra spaces and converting everything to lowercase. Then I use another Set Variable to standardize it to either “NS3” or “Drive”. After that, I’ll create folders on OneDrive based on this.
My formula is not correct, it’s dosn’t work. Here it is:
if(or(contains({{14.supplier_normalized}};ns3);contains({{14.supplier_normalized}};drive));NS3 or Drive;UNKNOWN)
Can you help me fix it?

:thinking: What is the problem & what have you tried?

tried to change the function

:clipboard: Error messages or input/output bundles

the module does not perceive the function, but perceives it as text

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

Hey Romano,

1st thats not a formula, thats a text string. Select the formula from the field to see the difference.

2nd contains() returns a boolean true or false value, if(contains(something)=true) is the core of the formula.

Whichever AI you are using to create this, is wrong.

It should be something like if(contains(name;ns3)=true or contains(name;drive)=true;NS3 or Drive;Unknown) but select the different functions from the menu instead so they are actually functions and not just text.

Stoyan, thanks for your response. I rewrote the formula:

{{if(contains(14.supplier_normalized; "drive"); "drive"; " or " + contains(14.supplier_normalized; "ns3"); "ns3"; )}}

It works better now. “drive” processes correctly, but “ns3” outputs: or true

Could you help me fix the formula completely?

Yeah select the or from the menu as well. And remove the empty spaces around it. Then add the rest where if either is true, still the correct name.

No, using the “OR” operator here is not correct.

What you want to do is to nest the if-statements.

{{if(contains(14.supplier_normalized; "drive"); "drive"; if(contains(14.supplier_normalized; "ns3"); "ns3"; null))}}

(copy-paste the above into the field, or type it exactly as shown)

e.g.:
Screenshot 2025-12-17 091923
(second if-statement underlined in red)

Hope this helps! If you are still having trouble, please provide more details.

@samliew

1 Like

Thanks for the tips)

The big Thanks, it helped)