Why isn't the result of my formula being recognized by the WeWeb UI?

CleanShot 2024-05-16 at 11.18.23

On submitting a form, I perform two actions:

  1. Transform a list of selected items from a multi-select input into an array of objects.
  2. Use that array of objects for a bulk insert into Supabase.

I wrote this JS code in the formula for Step 1:

var transformArray = function(array, initiativeId) {
    return array.map(function(value) {
        return {
            initiative_id: parseInt(initiativeId),
            resource_id: value
        };
    });
};

return transformArray(variables['ID-currentSelection'], globalContext.pageParameters['initiative_id']);

I can see that this returns an array of objects.

For Step 2, however, when I try to access the result variable of Action 1, it says the result is undefined.
CleanShot 2024-05-16 at 11.24.00

What am I missing here?

you need to test the action to have a value in the preview

1 Like

Face+Palm moment.

Thanks @dorilama!

1 Like