Creating a Dynamic Table & Saving Client Specific Data

I’m curious if someone might have ideas on how to approach this scenario. A client in Table A is assigned tasks from Table B. These tasks are saved in a column for the client in Table A separated by commas (Task 1, Task 4, Task 123, etc). I’d like to present this data in a grid where a user can enter scores for each of the tasks and then save the data with the scores corresponding to each task. See picture for how the user would see it presented in the app to enter the scores.

I created a Query column in Table A to pull the clients assigned tasks from Table B and it presents them properly, but I don’t know how to handle entering the scores and then saving that data for the client because the data-grid using the query restricts me to saving the scores to a Table B column. But since Client A’s score for Task 1 will differ from Client B’s score for Task 1, the scores need to be specific to the clients, not the tasks. I hope that makes sense.

Trying to save everything inline might require you to save the task data as JSON, not just a csv string of task numbers. For example:

[
  {
    "task_id": "T-001",
    "task_name": "Review Q3 financial reports",
    "due_date": "2023-10-25",
    "priority": "High",
    "status": "In Progress",
    "score": 85,
    "comments": "Focus on revenue and expenditure analysis."
  },
  {
    "task_id": "T-002",
    "task_name": "Draft marketing campaign proposal",
    "due_date": "2023-10-30",
    "priority": "High",
    "status": "Not Started",
    "score": null,
    "comments": "Brainstorm creative concepts first."
  },
  {
    "task_id": "T-004",
    "task_name": "Schedule team-building event",
    "due_date": "2023-11-15",
    "priority": "Low",
    "status": "In Progress",
    "score": 78,
    "comments": "Need to confirm catering options."
  }
]

Then, in a helper table, you’ll parse out the user specific JSON onto separate rows so you can display it in a list. When users edit the data, you’ll need a save button that wraps up the edits and overwrites the info back in Table A.

Not an easy task, but possible. @Darren_Murphy and I have had many a conversation about this. :sweat_smile:

2 Likes