Reduce number of searches in backend workflow

Hi,
I have a backend workflow that returns multiple parameters and for each of the parameters there is the same search. In other words, I need to do the same search multiple times. After the search, I have filtered/sorted the data in different ways to make each returned parameter unique.

I’m well aware it’s bubble sin to do a search multiple times. If this was on the front end, I would just have a hidden repeating group that stored the results of the search but, you can’t do that on the backend.

Is there an equivalent on the backend? Is there an action that I’m not aware of that returns the results of a search that can be used in a subsequent action so the search only can be done once?
Thanks in advance.
Paul

You can simply do the search in a separate step. Then you use the result of that step and apply the filters to it in the following steps.

Appreciate your help here.


Which action can just return a search?
Sorry, I might have needed to be more clear in my original post but the only thing this workflow api does is return data, so I am not creating a new thing or making changes to a thing anywhere in the workflow.

You can use “Make changes to a list of things…”.

Simply don’t add any parameter to it.

Of course. So simple. Thanks for your help. I’ve been bubbling for way to long to not have thought of doing that.
Thanks again

1 Like

@reger-alexander
One quick follow up question. Do you know how current user works in a backend workflow? I am helping someone out with their app and they are filtering results based on the user being equal to “current user”. Obviously current user makes sense on the front end but when a 3rd party is calling the bubble api, what value does current user take on? The api returns information which implies to me that “current user” is defaulting to a particular value?

Any ideas?
Thanks

I would expect it to be empty when called from a 3rd party.

When you schedule the workflow from the front end, the current user is the one who schedules the workflow.

But you could try it out. Simply create a new (dummy) thing when the workflow runs and set any field to the current user’s email.

Cool. Thanks again for your help.