Please help! How to filter and sort array keys

Hello,

I’m a “long time” user of Make/Integromat, but this is my first question on the help community because I’m really stuck. I tried to use Make AI, watched a lot a video about aggregator and I’ve read many posts here, but I still can’t get it.

I have a Webhook that I use as a trigger, from our WooCommerce business. Here’s how we use it: We sell tickets for our training courses in Woocommerce. For each item added to the shopping cart, a pack of conditional fields are sent by the webhook. Each field contains a suffix. For example :

  • firstname_01
  • lastname_01
  • email_01
  • firstname_02
  • lastname_02
  • email_02
    and so on.

This information is sent under the “meta_data” array of the webhook command.

I want to filter all the fields “_01”, “_2”, “…” in different modules, but I can never get the information compiled in a way to have this information. I’ve tried with the aggregator and router filters, but every time, I only have the “key” and “value” available, whereas I’d like to have “firstname” “lastname” “email”.

Any help or advice would be greatly appreciated! Thank you!

1 Like

Hi, this is the solution I came up with.

  1. Iterate on meta_data array
  2. Filter for your condition.
  3. Aggregate back together the array.

Note: you can set variables and use the magic variable method to call back the array of the sorted values if you need to.

You will just need to create as many filters as you have conditions here you have only 2 so this method makes sense and is pretty simple and easy to understand.

Let me know if this help!

2 Likes

Hi!
Thank you very much for the quick answer! This is exactly the blueprint I tested yesterday, with the same result as you, but it’s afterwards that I get stuck. How can I use the key/value in a following module (for example, “formation_courriel_1” in an email module)? I can only select “key” or “value” without precisely selecting which one I want.

Got it that makes it easier no need to use aggregator.

Let me know if im wrong but if you find 4 keys with _1 you want to send 4 emails to value.

All you need to do is remove the aggregator and use your email module. Just keep the filters.

Even there, I cannot select precisely the value of the key “formation_courriel_1”, with or without the aggregator :confused:


Sorry if I wasn’t clear in my last message, English is not my native language.

Hi is this what you are looking for?


You will need to add the aggregator back and use the set variable after.

3 Likes

Oh my god it works! Thank you !!!

1 Like

OMG! YAY! Happy it works!!

2 Likes