Search before create

I have a page to search for ‘person’. I also have a ‘Add person’ popup link for if the search gave no results. The issue is, I’d like to hide the ‘Add person’ button until the search has been done.
I’ve tried putting the ‘Add person’ button on it’s own list limited to 1 row, with ‘requires search’ ticked, so that it’d only appear after a search. But if there’s no results, that list itself won’t appear.
Can’t think of a way to do it- would it involve an event on the search button that set a state somehow that the button could check with a presenter?

Hi James, It can be done without code or an event…

If your search box and list are not in the same widget group add them to it. Next add an information box to the widget group based on the same object as the list. Change the “No Aggregate” to “Count (Having Value)” then add the ID Attribute to the information box. You can either style it/change the label or hide it.

Finally, with your popup link also in the same widget group, add a dependency on it for the Count of ID greater than Zero then Hide it. You will also need to get rid of the “requires a search” option so the list always shows something if no explicit search has been done

1 Like

Thanks Richard, that’s worked!