Hi
I’m attempting to build a local listings app for my local area stores and resturants to see if I can do something to help them get through the Covid pandemic. A key functionality is a “click and collect” capability primarily targeted at the resturants/coffee shops. I have a data type set up specifially for an individual dish in a menu called “Menu” and a data type for the business called “Store”. My theory was that that a dish would be tagged with a Store Name field identifying the resturant its attached to. When that resturant was selected from the listing it would pull all the dishes marked with its name only, into its menu to be surfaced up to the user.
I’m using a repeating group set up this way
The group containing the dish items is set up this way
The Parent Group already has the specific Store data in it.
When I do this I get all the items with Menu data type and not just the ones for the specific store I am curently viewing. I’ve been going round in circles for days and cant seem to be able to get them filtered down to just the store I have selected to view. Can anyone help point me in the rght direction?
Thanks
Niall
Hi there, @niallbrady… I could be off base here, but I’m pretty sure your store constraint isn’t constraining your search at all (which would explain why you are getting all of the items in the Menu
data type back) because it’s referencing the wrong thing.
If a user is able to select a restaurant from a listing (presumably from a dropdown), then I would expect the constraint to be something like Store = Restaurant Selection Dropdown's value
instead of Parent group's Store
. If you had it set up like that, the search would be able to compare the value that the user selected from the dropdown to the value in the Store
field for each menu item, and it would return only the relevant items.
Does that makes sense and does it seem like the thing that could be causing your issue?
Best…
Mike
1 Like
Hi @mikeloc
That makes a lot of sense. In this instance however the user selects a store logo (image) via another repeating group containing the listed stores (RepeatingGroup Store). Is there anyway I can us your logic with this scenario?
Thanks
Niall
Hi, @niallbrady… maybe set a custom state on the menu repeating group of a specific store when the store’s logo is clicked, and then compare the menu’s Store
field to the custom state’s value in the constraint… want to give that a shot?
Best…
Mike
Might be a dumb question, but would that require a seperate custom state for every store?
Nope… you would just change the custom state each time a new store is clicked. That being said, I don’t know exactly what your UI looks like or what your user experience is, so I’m kind of shooting from the hip here.
Thanks mate. I’ll give it a punt.
1 Like
Ok. Ive set a new state on slection of a store which is Menu. As you can see here I’ve changed the constraint from Parent group’s Store to the new states Store.

Still no joy. Could it be that I’ve set up the data type in the state incorrectly? Currently its set to the data type Menu.
Thanks
Niall
Is the state associated with the menu’s repeating group, and are you setting the state to the appropriate store via a workflow when a store’s logo is clicked?
I created an example that is the same (I believe) as what you have described for you app, and the constraint is working for me. Here is how the repeating group for menus is set up (with the custom state on the right and the search constraint on the left)…
Is that the way you have it set up?
Best…
Mike
Thanks for your help Mike.
I’ve repeated what you’ve done here. Can you show me how you’ve set the state to the appripriate store via a workflow?
Niall
Well, mine won’t be exactly like yours because I didn’t replicate your exact app. But, you will want a workflow step when a logo is clicked that uses the Element Actions >> Set State
action. In the Set State
step, the Element
will be your menu’s repeating group, the Custom state
is self-explanatory, and the Value
in your case will likely be something like Current cell's store
. Give that a shot and let me know how it goes, cool?
Best…
Mike
Dude. I owe you a beer. Looks like its working.
Thanks for all your help.
Niall
No problem at all, Niall… happy to hear it’s working!
Best…
Mike