Function call that executes after another to store the output

I create a function call that calls my api and get’s a list of products based on some search filters

The issue I have is that the actual list from the server contains certain products that are correctly not displayed by the model because they are interpreted (after I feedback the result.) I want to store what the model has mentioned as products in another array via another function but can’t see to trigger that