Need help to set up a "contains" filter, that works regardless from the words order

Hi, I would need some help with my scenario.
I’m trying to set up a filter that compares two names and only allows an item to pass if Name A contains all the words from Name B, regardless of the word order. Any advice on how to achieve this? I tried the Contains filter but that only seem to work when the words in the name are in the same order. For example Peter Daniel Cole would not pass through the filter if Name b was Peter Cole.

Welcome to the Make community!

Please provide an example(s) of 1.pulsename and 4.name

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

1. 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!

Wow! Thank you for the quick reply.

Output bundle of module 1:

[
    {
        "app": "monday",
        "type": "create_pulse",
        "triggerTime": "2024-08-12T08:44:20.495Z",
        "subscriptionId": 35075465,
        "userId": 43579338,
        "originalTriggerUuid": null,
        "boardId": 1589035310,
        "pulseId": 1593701395,
        "pulseName": "alex peter depew",
        "groupId": "topics",
        "groupName": "Incoming Answers",
        "groupColor": "#579bfc",
        "isTopGroup": true,
        "columnValues": {},
        "triggerUuid": "cb579fcff90b56f5eb91a784f314dc5a"
    }
]

Output bundle of module 4:

[
    {
        "id": "1166897005",
        "name": "Agnes Biolley",
        "email": "andqfive_pulse_1166897005_1f53962a60d7cc8ef2ac__43579338@euc1.mx.monday.com",
        "created_at": "2023-03-17T01:24:50Z",
        "updated_at": "2024-08-12T07:16:51Z",
        "state": "active",
        "board": {
            "id": "1166895441"
        },
        "creator_id": "39995048",
        "group": {
            "id": "topics",
            "title": "current andQFIVE Community",
            "deleted": false,
            "archived": false
        },
        "column_values": [],
        "mappable_column_values": {},
        "__IMTLENGTH__": 4,
        "__IMTINDEX__": 1
    },
    {
        "id": "1295596918",
        "name": "Ahmet Akın",
        "email": "andqfive_pulse_1295596918_1f53962a60d7cc8ef2ac__43579338@euc1.mx.monday.com",
        "created_at": "2023-10-18T08:43:41Z",
        "updated_at": "2024-08-12T07:16:53Z",
        "state": "active",
        "board": {
            "id": "1166895441"
        },
        "creator_id": "43579338",
        "group": {
            "id": "topics",
            "title": "current andQFIVE Community",
            "deleted": false,
            "archived": false
        },
        "column_values": [],
        "mappable_column_values": {},
        "__IMTLENGTH__": 4,
        "__IMTINDEX__": 2
    },
    {
        "id": "1166897017",
        "name": "Alex DePew",
        "email": "andqfive_pulse_1166897017_1f53962a60d7cc8ef2ac__43579338@euc1.mx.monday.com",
        "created_at": "2023-03-17T01:25:29Z",
        "updated_at": "2024-08-12T07:16:56Z",
        "state": "active",
        "board": {
            "id": "1166895441"
        },
        "creator_id": "39995048",
        "group": {
            "id": "topics",
            "title": "current andQFIVE Community",
            "deleted": false,
            "archived": false
        },
        "column_values": [],
        "mappable_column_values": {},
        "__IMTLENGTH__": 4,
        "__IMTINDEX__": 3
    },
    {
        "id": "1166897021",
        "name": "Alexandra Deutsch",
        "email": "andqfive_pulse_1166897021_1f53962a60d7cc8ef2ac__43579338@euc1.mx.monday.com",
        "created_at": "2023-03-17T01:25:45Z",
        "updated_at": "2024-08-12T07:17:42Z",
        "state": "active",
        "board": {
            "id": "1166895441"
        },
        "creator_id": "39995048",
        "group": {
            "id": "topics",
            "title": "current andQFIVE Community",
            "deleted": false,
            "archived": false
        },
        "column_values": [],
        "mappable_column_values": {},
        "__IMTLENGTH__": 4,
        "__IMTINDEX__": 4
    }
]

Welcome to the Make community!

Yes, that is possible. You’ll need a minimum of one filter:

Screenshot_2024-08-12_200836

Example:
Screenshot_2024-08-12_200825

Output
Screenshot_2024-08-12_200801

This is just an example. Your final solution may or may not look like this depending on your requirements.

Module Export

You can copy and paste this module export into your scenario. This will paste the modules shown in my screenshots above.

  1. Copy the JSON code below by clicking the copy button when you mouseover the top-right of the code block

  2. Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV (paste keyboard shortcut for Windows) to paste directly in the canvas.

  3. Click on each imported module and save it for validation. You may be prompted to remap some variables and connections.

Click to Expand Module Export Code

JSON - Copy and Paste this directly in the scenario editor

{"subflows":[{"flow":[{"id":268,"module":"util:SetVariables","version":1,"mapper":{"variables":[{"name":"NameA","value":"Peter Daniel Cole"},{"name":"NameB","value":"Peter Cole"}],"scope":"roundtrip"},"metadata":{"designer":{"x":3577,"y":-806,"name":"Set Names"}}},{"id":266,"module":"util:SetVariable2","version":1,"filter":{"name":"All words in NameB found in NameA","conditions":[[{"a":"{{268.NameB}}","o":"text:pattern:ci","b":"^(?:(?:{{join(split(268.NameA; space); \"|\")}})(?:\\s|$))+$"}]]},"mapper":{"name":"contains","scope":"roundtrip","value":"All the words in NameB \"{{268.NameB}}\" is found in NameA \"{{268.NameA}}\""},"metadata":{"designer":{"x":4013,"y":-807,"name":"Name A Contains All in B"}}}]}],"metadata":{"version":1}}

Hope this helps! Let me know if there are any further questions or issues.

@samliew

2 Likes

Thank you very much! Your solution worked like a charm!

I’m very surprised and impressed by the time between posting and getting the task solved!
Have a great day, you certainly made mine!

2 Likes

No problem, glad I could help!!

1. If anyone has a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.

2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.

This marks the topic as solved, so that:

  • others can save time when catching up with the latest activity here, and
  • allows others to quickly jump to the solution if they come across the same problem

To do this, simply click the checkbox at the bottom of the post that answers your question:
Screenshot_2023-10-04_161049

3. Don’t forget to like and bookmark this topic so you can get back to it easily in future!

Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —

Getting Started

Help Centre Basics

Articles & Videos

Partner & Custom Apps

Hope this helps! Let me know if there are any further questions or issues.

@samliew

1 Like