Workflow that triggers a page where item can be added

Within my DB, I have a few items that can be searched for on the frontend.

What I want is the following: when an item does not exist, I like the search button to trigger a pop-up that states something like (item does not exist yet, want to add it?), and then a workflow that redirects the user to a page where this item can be added.

Tried with this workflow, but that does not do the trick

SearchBox’s value is empty AND SearchBox’s typed text:extract with Regex (.[a-zA-Z].):count > 0

Any help would be appreciated. TY

I wouldn’t recommend navigating to some other page to add it…instead create a reusable element that has the popup asking if they want to add it, and another element to add it.

In terms of the use of extract with regex on the type text, it may be necessary for your use case, but I think generally is not needed to check if typed text is empty, I think we can just use expression type text is empty.

But your expression likely is working for your use case so no need to change that.

If you want to use that expression, you need to know how and if the user is done, so likely a button press to submit, I suppose is what you are using. So on that button click of submit, have the actions use the conditionally expression you have and show the popup and do not show the popup if the expression is not met and do whatever else you are doing.

Then after they press yes to add it, in the reusable element you should create, show the elements to add it. Then after it is added close the reusable element popup and your user is in the same exact place without navigation.

I think you’re overcomplicating it.

  1. When you click your button > set state to show popup = yes. Do when true (every time) only when [Do a search for items:first item is empty or :count is 0] show popup.

Or

  1. Set a state to the search bar text and when button is clicked > Do when true (every time) this states search bar text is empty

Or

  1. Make your search bar a text input, create an RG hidden that shows when you click the button, show your list of items in it, make the group a floating group that hovers below your search bar making it look exactly the same as a search bar does, but when this button is clicked ONLY WHEN do a search for items (constraint this items name contains this text inputs value)first item is empty or count is 0 > don’t show the group with RG in, show the pop up instead.

I agree with @boston85719 I wouldn’t navigate to another page that’s slow, but if you do want to do that once your user clicks your button in your pop up do a workflow > go to page > then choose what page it is.

You can just have another popup. When a user clicks your yes button in your pop up saying they want to add it, hide that popup, show another popup with all the inputs to add that item. Then on click of the button in that popup hide them all, save the item etc.

Not sure out of 1, 2 or 3 which is the best, most performant option but others may be able to offer guidance there.