How to add a row in a table with one property coming from the parent/screen page

Hi there !

We are using Glide for the first time and are loving it. Still, we are facing an issue that is blocking us.

Imagine you have a projects database. In these projects, we have always tasks that are similar; thus we have a tasks database.

For each project, we’d like to chose which tasks to add : we created a correspondence table ProjectsxTasks (projet_id, task_id).

Here’s our issue : inside a specific project page, we have our list of tasks with action buttons to add a row in the ProjectsxTasks table. When we configure the action, we are not able to select the challenge_id of the page :
image

Do you have any workaround ? Should we do it differently ?

Thank you in advance :slight_smile:

You’re probably approaching this the wrong way. Rather than showing a list of tasks on your Project Details page, here is what I would suggest:

  • Add a button, and label it as “Add Task”
  • Set the action on the button as Show Form Screen
  • Configure the Form to add a row to your ProjectsxTasks table
  • Add a choice component, set the source as your Tasks table
  • Add a Screen Values component, select the ProjectID and target it at your task_id column

Thanks Darren for your answer :slight_smile:

I can do that, but it means that I can only add tasks one by one, right ? It seems there is no multiple choices in form screen ? For each project, we can have like 20-30 tasks; what do you think ? Thanks.

Depends how you want to store them.
Instead of having a separate ProjectsxTasks table, what you could do is add a RelatedTasks column to your Projects table. And store a comma separated list of TaskID’s in that column. If you enable multi-select on your Tasks Choice component, Glide will generate that list for you. And then you can get a list of related tasks for any Project by first using a Split Text column to turn the joined list into an array, and then use that to create a multiple relation to your Tasks table.

Understood and implemented, thank you very much :slight_smile:

The issue we see with this solution is that our tasks table is quite long and when we choose which tasks to add to a project, it’s pretty annoying to add actions in the form screen. We liked the fact to have it outside a form screen because we can have filters and groups on our tasks table. For exemple :

Is there a way to reproduce this behavior ?

Well, yes. You could use the Trebuchet method. More work to set up, but probably closer to the behaviour that you’re looking for.

Thanks Darren, I’ll check and try that tonight :slight_smile: