Help with search box formula

I’ve set up an input search field to locate entries in a data list, then it directs the user to a details page about that entry once clicked. I’m using the workflow - When the Element (search box) value is changed, navigate to the details page and send the data about the entry that was selected in the search bar. So far, this all works fine.

The issue is that if I enter an unidentified value in the search field, it will direct me to the details page, but blank because no valid value was sent. I’m thinking I could apply some constraint to the Only When area of the workflow trigger to say “only begin the workflow when the value entered in the search field matches the ID in the list of entries.” Does that make sense, and if so, could someone help me with that constraint formula? I’ve tried a few options but haven’t gotten it right yet.

The ‘only when’ fuctionality seems just fine, that’s the condition you need to set

Hi @j21 :wave:

Entering an unidentified value in the search field will not make it change.
This is odd.

Did you alredy try:

This Searchbox'value is not empty

My data list includes a column for ItemID. This is in addition to the bubble-assigned unique ID. I want the search box to be used for finding an entry based on entering the ID. When I start typing a valid ID, I can see it appear as a recommendation under the search box. If I select that suggested entry, it takes me to the details page for that item. All good.

If I start typing an invalid ID and no suggestion appears underneath - I can still press Enter to search for the fragment of characters I’ve typed in the box. Since this does not align with an actual item ID - it still takes me to a an empty “item-details” page.

Hummm i get it…

So, what you can do is something like this in the ONLY WHEN field:

Do a Search for:first item is not empty

Search for entry A constraint by the value of the Searchbox.
If the first item of the result is empty, then it means that the inputed value is invalid.

Thanks for the reply. I did try this but still got the same result - I end up getting directed to the details page without any item details displayed. I appreciate the suggestions!

In thinking about this some more – what I want to accomplish is:

I have a data type called Items, with a field/column called ItemID.

I have a search box with a workflow that is set to take the value entered in the search box (ItemID) and pass it to a page where more details about that Item are displayed. The workflow trigger is when the search box value is changed.

On the actual navigation Step, what I want to do is stop the navigation from proceeding if the value entered in the search box is not an ItemID in the ItemID column if the Items data type. I started typing in the “Only When” area of the workflow step:

This Search Box’s value is…

…and this is where I can’t get a complete formula that bubble accepts as valid. What I want to say is:

The Search Box’s value is a value that exists in the ItemID field of the Item Data Type.

If anyone has a suggestion for how to format that properly, or if there is a completely different approach I should be taking, I’d appreciate the advice. THanks!

try this:
only when do a search for Items(itemid=searchbox’svalue):count > 0

1 Like

THAT DID IT! Thanks!

1 Like

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