Database query - how to hide specific coupon code's for users based off the store/items they are buying from

I am looking to only display coupons that are directly linked to the store the user is buying a product from.

I currently have a repeating group that is displaying the coupon information (sorted by value) in a repeating group.

How would I get the repeating group ONLY to display coupons related to the store the user is buying items from?

Here is currently what I have set up:

This is the repeating group on the page:

Here is the Coupon data type I created:

Here is the CartItem data type I created:

Here is the product data type I created:

Here is the dispensary (store) data type I created:

Considering dispensary = store…

you can put constraints on the repeating group …

dispensary = store user buying from

@ankur1

I am having a bit of difficulty formatting this constraint. Here is what I am seeing on my end- what should I be putting in the constraint section?:






**Here are the data types I created in my database. Let me know if you think something should be altered.**

Here is the dispensary (store) data type I created:

Here is the CartItem data type I created:

Here is the Coupon data type I created:

how store and product is linked?