Deep Array Filtering

Good Morning

I have researched the community for answers to my question but I am still not truly understanding a deep array filter.

To me it seems very simple that i should be able to search a database and return a bunch of answers in arrays.

Then based on a filter between to modules pass that information based on specific filter criteria.

For example

If i return 10 bundles in my search each with multiple collections i should be able to single out a specific collection and look for a match and allow it to pass through.

In the below picture inside of bundle 1 and collection 9 the value is true, i want this one to pass through the filter but not bundle 2 for example which doesn’t have a collection 9

Can some one explain this to me kindergarten style please, lol :rofl:

Welcome to the Make community!

Please provide the output bundles of the module shown in your screenshot by running the scenario, then click the white speech bubble on the top-right of each module and select “Download output bundles”.
Screenshot_2023-10-06_141025

A.

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

Uploading it here will look like this:

bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted output bundle in this manner:

  • Either add three backticks ``` before and after the code, like this:

    ```
    input/output bundle content goes here
    ```

  • Or use the format code button in the editor:
    Screenshot_2023-10-02_191027

Providing the 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!

2 Likes

Hi @Wade_S_Saxton

we have created a sample structure

Initially, we need to see if there’s a ninth collection in the array. We can do this by adding a filter to check if the array length is greater than or eqaul to 9. If it is true, then there’s a ninth collection. Also want to check if the data is true

finally to get the 9th collection’s data you can use map and get function :
note that change the ‘data’ in get and map function with the required value you want to pass


output:
provide the data of every 9th collection

If you require additional assistance, please don’t hesitate to reach out to us.
MSquare Support
Visit us here
Youtube Channel

2 Likes

This worked perfectly !! Thank you!!

Now how do I create variables based on specific bundles and i may have worded that wrong. Right now i can take all that data and create a variable that i run through chat gpt to separate out.

There has to be an easier way though for me to say i want to only pull some of the returned information.

For example what i see in my head is something like

Set Variable - Recipie_Name (This then = Bundle 6)

And then i create another variable

Set Variable - Recipie_Instructions (this Then = Bundle 4 )