What to do when an Api call serves multiple results? (Adalo just stores one)

Hi!

I am making a call to an Api where each call returns N results.

Everything works fine, but only one result is created in Adalo (I imagine the first one that comes to it).

Is it possible to create N items in each call?

Thanks!

Hi @mnlt,

If you use custom actions - unfortunately, it’s not possible.
You can try to connect this API as a External Collection, but this may not work as well.
I usually use Integromat to process all this data.

Best regards, Victor.

1 Like

Hi, @Victor !

thanks! Works fine!

two problems here:

  1. Adalo is faster than integromat’s flow, so adalo stores the results but doesn’t prints anything. Any solutions for this? (I’m trying with “sleep” module – no results yet)

image

  1. On the other hand, do you know if there’s any possibility to identify duplicates in Integromat?

What I’m struggling here is trying to know – before sending back the results to adalo – if any of the results from the api call already exists in Adalo (in this case by URL)

As you can see in the image:

  • (1st module) a form in adalo triggers a query. The query arrives to integromat (the webhook module)
  • (2nd module) the query calls an api (http…)
  • (3rd module) - the call is “iterated” by integromat (because of multiple results)
  • (4th module) - I ask adalo to list a collection (this is correct here?)
  • (router) - here I’m trying to know "if current iteration item exists in the adalo collection → update record, if not exists, → create new record (here is the problem)
  • (5th and 6th modules) then the results come back to adalo

I am not succeeding in telling Integromat “if it exists…” or “if it does not exist…” according to the one value that will always be unique (in this case the URLs)

Thanks in advance!
Manu

Hi @mnlt,

1 - try to turn on list auto-refresh for the list on the 2nd screen.

2 - In module 79 (4th module) why don’t you use Adalo List Records?

Best regards, Victor.

1 Like

Thank you very much @Victor.

  1. works perfect (why didn’t I think of that before? :sweat_smile:)
  2. I’m using list records as you suggested, I can’t get it work 100% (the flow still duplicates some records), but really close here!

thank you again!

Hi @mnlt,

As for me you need to check your filters :slight_smile:

Best regards, Victor.

1 Like

I’m still stuck there
I’ve tried so many things, I don’t know what I’m doing anymore :disappointed_relieved:

just in case you have 5 min!

Here’s the big picture:

  1. First step (modules 1 and 2)

    A query string arrives from adalo (1)
    The HTTP call, lists N items (2)
    Each element comes with a lot of data, I’m only using a Title, a Snippet and the URL (I’ve marked it with arrows in the following images)


  1. Second step (module 3)

    Adalo “list records” (3rd module)

    image


  1. Third step (iterator)

    We iterate each HTTP item

    image


  1. Fourth step

    I’m trying to compare step 2 and step 3

    currently trying this:

    1. upper filter (if url doesn’t exist in the Adalo collection → create new record)

    1. lower filter (if url exit → update the record with the same URL)

Sorry, I think that was a very long and detailed post. Maybe it was not necessary so much information

Thanks again, @Victor :pray: :pray: :pray:

Hi @mnlt,

Usually when you run the scenario once there is a result for each iteration, and you can examine each action (filters in your case). You can visually compare which data comes from HTTP request and from Adalo, and see if you’re comparing right things.

As for your scenario:

  • In my opinion you forgot to have Iterator after HTTP request. If it returns several bundles, you need to set up cycle before you list Adalo items.
    In my opinion (I’m not Integromat guru, but still) in your current scenario, the Iterator module will be called for each record in Adalo collection. E.g. you have 10 records, you have Adalo List Records, and this module returns 10 bundles, all of which are processed (List records inside is HTTP request + Iterator). At least this is my understanding.
    I would rather switch to the 1st version of the scenario: send HTTP request, get X bundles as a reply, Iterate for each bundle - list Adalo records and compare them to the data in a bundle.

  • I’m not sure it is a good idea to have a “fallback route” checkbox in the Router module. Usually it should be used to create the “last default” route, which is not your case: URLs can match or not, you have only 2 options which are mutually exclusive.

  • Check the conditions on both filters. Check that you’re using Text comparison (not Numeric or other). Also you may try to use case-insensitive comparison.
    Again, you can check how filters worked after scenario run, this will provide some insights.

Best regards, Victor.

1 Like

Finally got it!

What I have done is the following (in case someone else find it useful in the future):

image

List the current records in Adalo, then iterate them and use a “text agregador module”

To check if any http response is contained in the “agregated text” and as I want to compare an URL vs text, I use the “decodeURL” function, converting the URL into a text string:

image

sometimes the flow is not fast enough and duplicates some results. I have placed “sleepers” to see if it works better.

Thank you @Victor for your help!

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.