Forum Academy Marketplace Showcase Pricing Features

Having to click 'search' twice for results to show up

I’ve seen this asked before in forums but without any solution…

I have set up a search button, and results show up in a repeating group. It was working fine last week but I must have changed something at some point because now it seems that I have to click “search” twice before any results show up. I have a pop up set to appear when search results come back as 0, so that pops up but if I click search again, the results are there.

Any idea how I can fix this?

Hi @rosekherr

If you send screenshots of the problem (flow details and the rg expression and constraints), folks could provide suggestions on how to solve in an easier way :grinning:

Here are some screenshots if helpful.
Users click on the button “find my polish color” , and the repeating group is supposed to display search results based on what is inputted in the color input field. But as mention in original post, they have to click that button twice in order for results to show up.

Thanks!

What does the condition “this button’s searched” do or what does it look for?

So the search is looking for items in a database - if what’s searched is not there, I want users to be able to add it to the database. So a pop up will appear saying “not in our database, want to add?” - i had to set a state so that the pop up would only show up once the search happened. otherwise it was showing up when the page loaded because the list was empty.

thank you for your help! let me know if there is any other info i can provide.

@rosekherr

Thanks for the info however I do not follow. Perhaps you can let your editor be accessible as public (as reader only) so when I have a min I can take a peek and advice (or any other folks from the forum who want to help)? (indicating what page it is)

This is done in settings.

appreciate it. just changed settings to ‘everyone can view’ - is that where i make that change?

it’s on the Index page.

This is the external page. I meant the backend.

Anyways, I am clicking and I get a popup after that. So … no 2 step going on here.

sorry - I don’t know how to share back end. If you tell me how, i’m happy to share.

Can you try searching “red” - you’ll see the pop up. but then click search button again, and you’ll see the results.

ah! had done that but didn’t deploy. can you try now?

Hi there, @rosekherr… you didn’t need to deploy in order for us to see your editor, you just needed to provide a link to the editor itself. That being said, we can use the name of your app to create a link to your editor, and I took a look under the hood.

After poking around a bit, I’m pretty sure the custom states you are setting when the search button is clicked (especially the one on the search button itself) are causing the behavior you are seeing. However, you can accomplish the desired results without the custom states, so I will throw the following out there as food for thought.

Keep the not found group as not visible on page load, and remove the conditional on that group. Also, you don’t necessarily have to have the repeating group inside another group; you can keep it visible on page load because it won’t show anything until a search is performed. Finally, the workflow on the search button would be configured as follows:

  1. Hide the not found group (probably not necessary but can’t hurt just in case it is visible when the search button is clicked)
  2. Display the list in the repeating group (you don’t need any conditions on this step)
  3. Show the not found group only when the repeating group’s list count is 0

I tested what I wrote above, and it seems to produce the desired results while simplifying things a bit. Want to give it a shot and see if it works for you? If you need any help getting it working, I would be happy to provide screenshots from my test.

Hope this helps.

Best…
Mike

1 Like

Thank you so much Mike! I will give this a try tonight to see if I have same outcome.

The reason I had put the repeating group inside another group, was based on another tip I had seen. Because this is a form, I want the group to collapse until the search results show up , so that the rest of the form shifts upwards. The recommendation was to put the RG in another group and have that collapse. Is that not necessary?

@mikeloc As always, above and beyond the call of duty Mike!

Awesome stuff! :+1:t2:

2 Likes

Ah, sorry about that… I should have realized that’s what you were doing with that group, but I was focused on the specific issue you are having, and I was trying to simplify things as much as possible. You definitely can put the repeating group in another group (which is not visible on page load and has no conditionals on it) for the purpose of having the form collapse, and that setup would only require that you include another workflow step between steps 2 and 3 in my other response. The additional step would show the collapsible group when the repeating group’s list count is greater than 0.

1 Like

Thank you both so much for your help with this! I was able to follow Mike’s steps and it’s working now. Honestly, looking at it with fresh eyes tonight, I think the cause of the original issue had to do with how I set up my search (because some of my inputs are named similarly I think I put the wrong one). However, your solution did help simplify it. I am not that familiar with custom states (someone had advised me to use them) so it’s easier to have it set up this way anyway.

thank you again @mikeloc and @cmarchan for all of your help!!

2 Likes