Transferring data from user specific coloumn

I am currently making a booking app where businesses can upload their services and availability. On the costumer end they should see the services offered as well as available times for the service depending on the business they chose, but because I made the business information user specific only the business owner can see them. Is there a way I can get around this?

Ya, you’ll need to move away from user specific data (on the customer end) and use helper tables instead. JSON structures will be your friend here.

One method:

  1. Keep the user specific table for the business to set their hours
  2. When a business hits a save button on the front end, save this table as a JSON object to the business table (easier said than done)
  3. Create a helper table (or even reuse the user specific set up table) to parse the json of the business that the user is currently viewing (also easier said that done)
  4. Display this table data to the customer.

I’ll need to create a video on this. I do cover something similar here:

Before we get too deep in the weeds with helper tables and JSON…can you explain why you made the columns user specific? I assume there is a row for each business? How is your data structured? Was each business updating several rows of user specific data or is everything for a single business only in each business’s rows? Just trying to get a visual of what you have right now. Screenshots would be helpful.

1 Like

Certainly! Here’s a refined version of your explanation:


Currently, the services table may seem a bit disorganized, but here’s how it works: Business owners enter information about their services, including the name and duration. This information is then made available for customers to view.

I designed this system to be user-specific because only business owners should have access to input their services. If it weren’t user-specific, all business data would mix together when displayed to customers, leading to confusion.

By making it user-specific, the data inputted by each business owner remains private and is only visible to them which is the problem.

Let me know if you need further clarification or additional details!

So nothing in that table indicates which business each service row belongs to? I think it would make a lot more sense if you had a business ID included in that table. That way there will be a row for each business/service combination. It’s easy to set conditions regarding who can edit each row, so each business can only edit their own rows.

User Specific rows designed so each user can input their own values into the same cell. They are not meant for controlled who does or does not have edit access. If you have a button to open an edit screen, you can easily put a visibility condition on that button to one show it if the business ID matches the ID in the user profile for example.

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.