Workflows optimization for repeated do a search for's

I have a question regarding how to save WU in the workflows.

My app is built as a single page app. There are several Do a search for’s used here and there. So, I put many of them at a When page is loaded workflow and save each result in custom states for reuse. And when I switch pages (tabs), I use Go to current page with page URL params.

When I checked the log, I see most of WU usage is consumed by these Do a search for’s. So, I am wondering if go to current page triggers page load each time and the Do a search for’s are taking place each time as well.

What would be the smartest way to handle this if there were any better way?

Yes - when you run ‘go to page’ on the same page, the on page load WF will get triggered.
One way could be adding a condition on the step that does the do a search for to check whether the corresponding state is empty and only trigger it then.

1 Like

Wow… awesome tip!!!
Thank you so much, @ranjit.

If you don’t mind, may I ask you one more thing other than WU?

I have inputs with default data displayed from the DB. I want to add a feature to clear the value when a user focuses on the input to make changes (currently, you have to select the displayed texts and remove manually). How can I achieve this? Do you happen to know?


Sounds like it’s the initial content property that you want to manipulate
I’m assuming you don’t want to affect the thing from the DB that’s currently linked to the initial content property of the input.
You could try setting a conditional on the input for when the input is focused, and make the initial content blank on this condition.
Else, simply use the content from the DB as the placeholder text of the input instead of the initial content content.

This topic was automatically closed after 70 days. New replies are no longer allowed.