Hi everyone! Pretty new though I’ve tried to find the answers myself. I am trying to allow drivers on my app to type in a list of zip codes that they service and then be able to match a rider in a certain zip codes with drivers who service that zip code.
What would be the best way to go about creating the functionality to allow the drivers to create a list of zip codes i can then search? I was thinking a multiline input field and then using regex to pull out each zip code into a list of numbers/text?
Not sure if that would work or if maybe there’s a better way to do it?
Just create a data type called zip codes.
Have a input in driver user area where he add zip code in at and hit enter a new row is created with zip and driver associated with it.
Now if rider search for a particular zip code, list will appear with the drivers profile, where we can choose which driver are available for the particular zip code.
1 Like
Hey @bidoncontracts !
Using a multiline input field is a solid choice. You can have drivers type in their zip codes. Once they submit the form, you can use regex to grab each zip code from the input. For example, something like [\d]{5} can help you find those standard 5-digit zip codes.
When it comes to storing the data, you can save those zip codes in a list field in your database tied to each driver. This way, you can easily check which drivers match a rider’s zip code later on.
For matching riders, when they enter their zip code, you can run a search query against the driver’s list to find those who service that area.
If you want to get a bit more advanced, consider creating a separate data type for zip codes and linking them to drivers. It can make your searches a lot more efficient.
Hope that helps! Feel free to ask if you have any more questions or need further clarification on anything!