Question

Is there a way to put a condition in my Filter when files contain a specific or upper case character?

  • 9 September 2022
  • 5 replies
  • 390 views

Hi everyone,

I am trying to make a zap work and I've been having some trouble, I need to take information from one place to another, in my zap I have an action to filter out stuff I don’t want, I only want entries to come in when they contain a specific character or an upper case character.

I was able to accomplish ¾ of what I wanted with the Filter → Text (Contains) → character I want to keep.
But I can’t seem to find a way to also put a condition to also give me when there’s an upper case character (anywhere in the string of text i’m bringing.

 

Thanks


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

5 replies

Userlevel 7
Badge +14

Hi @Olivier Lepage 

Good question.

You may have to use REGEX to help match using a Formatter step first before the Filter step.

https://zapier.com/help/create/format/find-text-with-regular-expressions-in-zaps

Hi @Troy Tessalone

I had seen that post. However, I'll be really honest I'm new to all of this and I couldn’t figure out how to get the Regex working.

Ideally, I would use that Regex to extract all the characters I need from my input rather than doing the regex + another step to filter.

What Regex would allow me to identify if the string contains either capital letters and / or the following characters : “$”, “_”, “.”

Thanks!

Userlevel 7
Badge +14

@Olivier Lepage

There is no filter condition for capitalization, thus the need to first use REGEX then use a Filter step.

Perhaps you can outline a few examples that cover the different uses cases for us to have context.

@Troy Tessalone Sure, here are some small examples ;

tesThello-1-2-3-4-5-6 (This one should come through because of the capital T)
test_1_2_3_4 (This one should come through because of the “_”)
test$$$$1234 (This one should come through because of the “$”)
test...1234 (This one should come through because of the “.”)
test-1-2-3-4-5 (This one should not come through because it doesn’t have any of the bad characters or capitals that I want to see in my output)

The end goal I'm trying to achieve is Zapier this to filter some data into an excel sheet, and the data I want to come through is the “bad” data that I need to fix in the app I’m pulling that data from.
It’s probably unconventional a bit but this is a work-around I'm having to build because the app I’m pulling the data from we’re using doesn’t allow us to not accept the bad characters.

Hopefully this is enough details :)

Userlevel 7
Badge +14

@Olivier Lepage 

A Code step can be used to do this checking before the Filter step.

 

CONFIG

 

RESULTS

 

CODE

let X = inputData.X;
let Y = X.toLowerCase();
let Match = false;

if (X === Y) {
Match = true;
}

if (X.includes(".")) {
Match = true;
}

if (X.includes("_")) {
Match = true;
}

if (X.includes("$")) {
Match = true;
}

output = [{Match, X, Y}];