Post days and times from WeWeb in Xano datatable

Dear Community,

I would like to give users the opportunity to indicate on which days they are available and at what time. In terms of days, my most obvious solution was to create one column per day. However, if I do the same for the time, I end up with 14 columns (apart from the fact that I don’t know how to store the information saved by the time picker in a column (timestamp?)).

I am still a complete beginner and wanted to ask if there is a smarter solution? And how can I bind my time picker (range) informations in a column in Xano?

Thank you! <3

Hello @Adrian,

I am not an expert in backend architecture, but I would do that by creating a table with 4 columns (or 5 depending on how the time is defined):

  • id
  • user_id
  • day
  • time (or start & end with 2 columns)

You can add a row for each day, a user can have a maximum of 7 rows. It will easier to manage and create

Tell me if it doesn’t fit with your use case. And if not, could you please give us more detail :slight_smile:

We have a video about the backend in our academy, if you want to take a look: WeWeb Academy

Hello @Mael, thanks for your answer!

This would be my solution for now, but I am sure that there will be a smarter more efficient solution in the future. It feels like there are too many columns in one table…


Hi @Adrian :wave:

I think there are a few questions to ask yourself before you can choose the best approach to structure your database.

For example:

  • can one user offer multiple services or just one service and that service is available at different times and days?

  • can one service be offered by multiple users? and if yes, are the times and days shared (e.g. a bakery) or should they be separated by users (e.g. two doctors sharing a practice)

  • in the service table, will users create, update, and delete services regularly? for example, could it be that a yoga teacher offers a class on Monday between 2-3pm one week and the next week it will change?

Hi @Joyce

  1. One user can only offer one service.
  2. The service is a synonym for “opening hours/days”. So if there are users with opening hours which are identical, I think one service can be offered by multipe users…
  3. Yes, users will create their service once and possibly update it regulary. Yes It could be that the teacher in your example changes his “opening hours/days”.