How to filter a text and go to different route based on outcome

Hi all,

I have an excel document with two rows: A(keywords) and B(links).

If a keyword in row A is found, it needs to fetch the link. This link needs to be added to the creation of a blog article.

So basically what I’m looking for is a system that will filter my content on specific keywords, and add relevant referral links when certain keywords are found.

I feel like this should be super simple, but for some reason I run in all kinds of testruns that don’t work.

This is what I tried:

  • RSS Module: Fetch article.
  • Google Sheets Module: Fetch the list of keywords and links.
  • terator Loop through each keyword.
  • Text Parser / Match Pattern: Check if the keyword exists in the article content. Stop after first match.
  • Router:
  • Branch 1: If no keyword match, go on without link
  • Branch 2: If a keyword is found, create the article with the matching referral link

I worked on this flow for hours but I couldn’t get it to find the match. But maybe it’s my lack of technical understanding here…

Then I thought… let’s check if I can do it with AI.
This is my setup:

However, now it makes the number of rows in keywords in chatgpt completions (operations). But I only want it to make 1 chatgpt completion, the one with the matching keyword, or if it doesn’t contain the keyword, one completion without keyword/link.

I also don’t know if it would be possible to filter out the chatgpt completion that I would need. Any thoughts on this?

My next step would be trying variables, but I have the idea that I am maybe thinking too difficult about this.

Any help or ideas would be highly appreciated!

Welcome to the Make community!

You haven’t provided any screenshots of your filters, or examples of your variables.

To allow others to assist you with your scenario, please provide the following:

1. Relevant Screenshots

Please share screenshots of your scenario, any error messages, relevant module fields, and filters in question? It would really help other community members to see what you’re looking at.

You can upload images here using the Upload icon in the text editor:

2. Scenario Blueprint

Please export the scenario blueprint file to allow others to view the mapped variables in the module fields. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.

3. Output Bundles of Modules

Please provide the output bundles of the modules by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.

A. Upload as Text File

Save each bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

B. Insert as Formatted Code Block

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles.
These are the two ways to format text so that it won’t be modified by the forum:

  • Method 1: Type code block manually

    Add three backticks ``` before and after the content/bundle, like this:

    ```
    content goes here
    ```

  • Method 2. Highlight and click the format button in the editor

Providing the input/output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

Following these steps will allow others to assist you here. Thanks!

Hey Sam,

Thank you for explaining. Makes sense.

In the meantime, I found a solution.

I added in the HTTP model and in the match pattern I added REGEX tags. after this it gave me a good result.

To solve the bundle problem I added in an Array for the value only. This way I filter only a response that has an actual keyword match. After that, I put in an iterator so I could grab the value, link of the referral and the article text from the grey area. Since chatgpt wouldn’t be able to access that directly otherwise.

For filter I used the array link. If it contains “HTTP” it will go to create article with referral. If it doesn’t contain “HTTP” it will go to create article without referral.

Hope this helps anyone who is looking for a similar structure.

3 Likes