• Instructions to Ask a Question

    Click on the "Ask a Question" button and select the application for which you would like to ask questions.

    We have 5 different products namely - Pabbly Connect, Pabbly Subscription Billing, Pabbly Email Marketing, Pabbly Form Builder, Pabbly Email Verification.

    The turnaround time is 24 hrs (Business Hours - 10.00 AM to 6.00 PM IST, Except Saturday and Sunday). So your kind patience will be highly appreciated!

    🚀🚀Exclusive Discount Offer

    Just in case you're looking for any ongoing offers on Pabbly, you can check the one-time offers listed below. You just need to pay once and use the application forever -
     

    🔥 Pabbly Connect One Time Plan for $249 (🏆Lifetime Access) -  View offer 

    🔥 Pabbly Subscription Billing One Time Plan for $249 (🏆Lifetime Access) - View offer

Partial Match in Filter Ex. "marketing" is passing when the word is "telemarketing"

nicheweb

Member
My filter is marked as contains and looks for the word "marketing". We just had something come through for "telemarketing" since that contains my filter, but I only want to look specifically for the word "marketing". I tried adding extra spaces before and after so it is " marketing " but that didn't seem to work.

What else can be done?

For context, we are evaluating a pargaph of text and I want it to pass if the word "marketing" exists in there, but not as part of a larger word. Thanks!
 
P

Pabblymember11

Guest
Hey @nicheweb

For context, we are evaluating a pargaph of text and I want it to pass if the word "marketing" exists in there, but not as part of a larger word. Thanks!
Do you want to process the filter action step with the following condition, if yes then it is working fine.

1705143897734.png


If the issue still persists then kindly share the workflow URL with us.
 

nicheweb

Member
Hey @nicheweb


Do you want to process the filter action step with the following condition, if yes then it is working fine.

View attachment 36575

If the issue still persists then kindly share the workflow URL with us.

The text I want to filter would be a paragraph so for example "A telemarketing company called me". I only want it to pass if just the word "marketing" is in the paragraph, not when "marketing" is part of a larger word etc. So I want to filter for the word "marketing" and I would want "A telemarketing company called me" to fail but "I like marketing" to pass.

How would I do this?
 
P

Pabblymember11

Guest
Regarding your concern, you can make use of the Code by Pabbly action step and identify the specific word from the given string.

2024-01-15_18h35_50.png


function containsMarketing(inputString) { // Convert both the input string and the target word to lowercase for case-insensitive matching let lowercasedInput = inputString.toLowerCase(); let targetWord = "marketing"; // Check if the lowercased input string contains the lowercased target word return lowercasedInput.includes(targetWord); } // Example usage let inputString = "Our marketing strategy is top-notch."; if (containsMarketing(inputString)) { return("The string contains 'marketing'."); } else { return("The string does not contain 'marketing'."); }
 

nicheweb

Member
Ok thank you very much for your help. I also want to say i don't expect any coding help with my next set of questions, rather I want to rely on your expertise for letting me know about the best way of going about solving my problem.

1. The filter I'm using is checking for multiple words - See attached image. B/c of this, I think I would need to get rid of this step and then add in a router step and each route would have a filter checking for each of my words, then I would run the content through the javascript you shared.

So my question is this: Is this the best / most efficient way to accomplish this?

Question 2. I ran a paraph of text through the javascript you provided and it came back with an error b/c the text I input had quotes and other punctuation and so the javascript didn't like that since various things hadn't been properly escaped. I can have our dev take a look at this part of the issue, but I figured I would ask if there was a quick and easy way to fix this before sending it over to them.

P.S. My workflow is https://connect.pabbly.com/workflow/mapping/IjU3NjUwNTZlMDYzMjA0MzQ1MjZkNTUzNjUxMzYi_pc and I added the router step at the bottom and the javascript into that first Route1.

Thanks so much!

1705335146303.png
 
P

Pabblymember11

Guest
Feel free to check out the updated code below. It's designed to identify specific words in your content and provide a tailored response. You can use this response to set up a filter action in your individual route, ensuring a more customized and efficient workflow.


2024-01-16_12h18_01.png


function findSpecificKeyword(inputString) { // Convert the input string to lowercase for case-insensitive matching let lowercasedInput = inputString.toLowerCase(); // Define the target keywords let keywords = ["marketing", "website", "directory", "review"]; // Split the input string into individual words let words = lowercasedInput.split(/\s+/); // Find the first keyword that is a whole word in the input string let foundKeyword = keywords.find(keyword => words.includes(keyword)); // Return the found keyword or a message if none are found return foundKeyword ? foundKeyword : "No specific keywords found in the string."; } // Example usage let inputString = "Our strategy review involves social media and content creation."; let result = findSpecificKeyword(inputString); return(result);
 

nicheweb

Member
Thanks, I put in this code and it is not working, still running into the same syntax error issues - see image below.

1705426293934.png
 
P

Pabblymember11

Guest
You need to pass the content in the "let inputString" key of the code-

2024-01-17_16h02_01.png


Also, please do share the workflow URL in which you have tried the same.
 

nicheweb

Member
You need to pass the content in the "let inputString" key of the code-

View attachment 36727

Also, please do share the workflow URL in which you have tried the same.
Ok thank you so much, this has been so helpful and I'm almost there. The only thing is the code you provided seems to only work for single words and not phrases and my apologies if I did not mention that before. Is it possible to have the same functionality we have been talking about but also have it work for "marketing person" as the phrase so it would only match if specifically "marketing person" was in the text, but not match if it was "telemarketing person" ?
 
P

Pabblymember11

Guest
You can add all the keywords you wanted to search in the given content -

1705574720895.png
 

nicheweb

Member
Ok Thanks. One problem I found is when we are scanning the list of words for cities, oftentimes people will put the city, state and so that isn't getting picked up. Is there anyway to edit the code so that if there is a comma, that doesn't cause a fail? Right now Chicago Illinois would be a pass for keyword "Chicago", but Chicago, Illinois would not since it has the , right after the city.

Thanks!
 
P

Pabblymember11

Guest
You can use Chat GPT to customize the JS code based on your needs. Chat GPT will generate the code according to your specifications by providing instructions.
 
Top