I built a marketplace for sellers and users.
A seller can offer different services and each service has a different price/hr.
The database is set up as let’s say:
Example: Seller A offer service for copyrighting, marketing and social media. So when Seller A creates a listing, he enters a different price/hr for each service.
Now, User A goes on the listing page, where he gets to see all the sellers. He decides to filter the RG based on sellers who offers copyrighting services. In the RG, I show the price only for copyrighting since that’s the service User A chose.
The current way I did this, is I have different text field and each field shows the price for the different services the seller is offering using conditionals for each service
text: current cell’s social_media_rate → show only when dropdown contains “social”
text: current cell’s marketing_rate → show only when dropdown contains “marketing”
text: current cell’s copyrighting_rate → show only when dropdown contains “copy”
This way works. However, it’s very tedious and inefficient because:
- For every service, I have to create a new text field with different conditionals and text field. And as you can imagine, I have more than 3 different services a seller can list on the app
- If I have to make any change to a text field, I have to change it for every service’s text field
- It also, makes the app heavy and it takes longer to load.
Is there a way to have only 1 text field that dynamically gets the right price from the database based on the user’s selection from the dropdown?
I’m thinking something like “do a search for” but I don’t know how to get it to work.
You’ll need to make another datatype called “Service” or something, and it has a text field for the service name, and a number field for the price. Then a “Seller” field with the same type as your seller (User?).
Then you make an interface for the seller to Create a new Service thing.
I think you just need a new perspective. Why don’t you have a nested repeating group of services within each user cell? and when the search field is not empty show only users who have that service and display only that service’s price
When creating the new datatype, does the service name text field need to be written the same way as in the dropdown?
Example: can I have it written as “social_media” in database but in the dropdown on the UI it’s written as “Social Media”?
Also, in the RG, I show the user the seller’s info and the prices. Since the seller info and price/services are two different datatype, how do I show both info in the RG since the RG needs to have a type of content (either service or seller info)?
Thank you for the input! But I don’t want to show all the price for each service right away because it takes a lot of space on the page I have other info showing other than the price. So I don’t want to throw too much info at the user.
It might be worth creating a few datatypes:
Service: Text field for the name. (this will be a large database of all the possible categories that they pick)
Service Price: Service field, Seller field (same type as your Seller datatype, User?) , Price number field. (What I proposed previously but instead of a text field it stores what category the service is in)
Then your dropdown data source could just be
Do a search for Service
And your repeating group data source being
Do a Search for Service Price with a constraint
Service = Dropdown's Service
Then when the sellers list offerings they can pick from the list of Services to categorize their listing. Or even make a screen to add new Services. Also these names could be adjusted, it could be called a Category instead of Service, etc.
Alright… Looks like I would have to rebuild the app’s architecture. Thought there would be an easier way to get this to work.
Thank you, I appreciate your input on this!