Where am I going wrong? Is it DB related?

I’m building a project for users to search for businesses in their local area.

I’m struggling with pulling data from the database from the landing page. E.g. a user visits landing page, they then enter name, email and select their ‘town’ from the dropdown, then hit ‘search’.

The user is then re-directed to a new page, where I want to display the prices and available dates of any business that has coverage in the area selected in the dropdown.

I’ve been playing around with sending data to the redirected page via url. Then using that parameter as like a filter within a dataset, but it doesn’t seem to show me the right data from this. I’m wondering if my database is setup correctly (see below) or if I’m doing something wrong.

The database looks like this:

Business

  • Email (text)
  • Name (text)
  • Phone Number (text)

Collection Dates

  • Business (links to Business)
  • Available-Status (yes/no)
  • Collection Date (date)

Coverage Area

  • Business (links to Business)
  • Region (text)
  • Town (text)

Town Capacity

  • Business (links to Business)
  • Capacity (number)
  • Date (links to Collection Dates)
  • Towns (links to Coverage Area)

Size Pricing

  • Business (links to Business)
  • 6ft Price (number)
  • 8ft Price (number)

To summarise this, I’m trying to find a ‘Town’ from user dropdown in the database that matches a ‘Town’ that the business has in their ‘Coverage Area’, which should then allow me to show ‘Collection Dates’ and additionally see ‘Size Pricing’ for the business in that ‘Coverage Area’.

Any help appreciated!

Share screen shot of how you setup the search already, and the expression for getting town from url

Hi, thanks for replying @boston85719 !

I recorded a quick video to show you: Database Structure and Search Expression | Loom

Kind Regards,

Calum

Hi, I think the issue is in your repeating group constraint where the ‘Coverage Area’ is not matching with the town parameter form URL. Because the value of coverage area is an ID, so it won’t match with the name of the town in the URL.

One solution of how you can link the data type with the town in the URL is by creating a data field in ‘Business-V2’ called ‘Surrounding Towns’ or whatever name you prefer with type ‘list of texts’. Then input the names of the surrounding Towns (Eg. For Manchester: ‘Manchester’, ‘Oldham’, ‘Bolton’). So in your repeating group constraint, use ‘Surrounding Towns contains get town from URL’.

I hope this helps. Please let me know if anything needs clarifying and if you have any further questions.