How to autofil values when a new row is added in a relation?

Hi Team,

Quick Question
How to make sure my ‘Tasks’ added to a ‘Meeting’ are automatically assigned to the correct ‘Client’?

Long Questions
I have a ‘Tasks’ database that can be assigned to a ‘Client’
I have a ‘Meetings’ database with the following notable columns

  1. ‘Client’ single select drop down
  2. ‘Tasks’ relation shown as a table
    (See photo below)

Ideally when I create a new ‘Task’ I would like it to autofill the ‘Client’.
I tried the following formula on the ‘Task’ database ‘Client’ column but it didnt work.
=Related Meetings.Client

At the moment any task created in a meeting has to be manually assigned back to the client.

Does anyone have any recommendations?

Hi @Logan_Krantz,

I build a quick a demo for you which can be seen below.

First, for the client to be automatically associated with a meeting you have to use buttons as otherwise Coda doesn’t know the context you are in (which client meeting you have)

See the doc below and let me know if it is what you wanted to achieve.

Hi @Cristian_Nichifor , Thanks for the quick reply.
Yes a button does work. It has the following limitations which I am hoping to avoid

  1. On the ‘Meeting’ record, ‘Tasks’ table we need the ‘New row button below table’ as it allows us to search for existing tasks and link them. However, this creates a scenario where uses may click the ‘Add Row’ button instead of the ‘Add Task’ button.


    In this scenario, the system does not auto fill [Client] on the ‘Task’ record when the ‘New Row’ button is clicked or a new task is linked.

  2. Its not such an issue in this example but extra controls clog up interfaces and I try to avoid them were possible.

Two solutions I have already tried are

Limited Solution 1: Automations. E.g. Onchange on the ‘Task’ record, THEN

[Client]=
SwitchIf(
  [Client].IsNotBlank(), [Client], // Dont override a manual value
  [Related Meeting].IsNotBlank(), [Related Meeting].[Client] // Grab client from related meeting
)

However, these automation are quite slow and cut into the Limited Automation Runs.
At the moment they are the only consistant solution though.

Limited Solution 2: Adding a default formula.
E.g. On the ‘Task’ record, if [Related Meeting].IsNotBlank() THEN [Client]=[Related Meeting].[Client]
However, this does not appear to work. I can only suspect it is a back end timing issue with coda. For example, on the ‘Task’ Record created in a meeting the default formulas appear to run just before it autofills [Related Meeting]. Since [Related Meeting] is empty at this time [Client] is also left empty.

I hope this post spikes more interest and get get some cool ideas or someone can help shed some light on the timing issue described above.

Hi @Logan_Krantz ,

Ohh, I got it :slightly_smiling_face:

Please check my doc again. I edited the Add task button so that users can select the tasks that do not have a meeting associated to them without you having to leave the page/row unlocked.

Now an user instead of having to press by mistake on create row when they instead only wanted to search and add an existing task they will have to choose & select in the relation above the task table from one of the already existing tasks that do not have a meeting associated with it. Then the user can just press Add task for everything to happen in the background.

This is a cleaner way of doing it as it doesn’t leave the things unlocked and prone for stuff to change by mistake. You have to first guide and then restrict the user into doing what you intend them to do as doc maker/process owner etc.

Let me know if anything.

on #2, why not hide the “bottom new row button” ?
image
so that you then at least “force” the user to use the add new task button.

additionally, why not move the “add new task” button closer to the table so it feels more natural?

Hi team, thanks for all of the replies.

I am not a fan of the button method because if the table was working adding a new task would be as simple as typing and clicking enter. The button method requires more steps to make and use. This has proved to slow down brainstorming in meetings.

What’s more, I have it working without buttons. But only in one place and cant replicate it. Take a look.

[Venture] autofill’s correctly on the ‘Task’ when created from ‘Contact’ → Working!

Note: ‘Client’ was renamed to ‘Contact’.
chrome 2024-07-16 T21.36.38.728
(GIF 1)

[Venture] IS EMPTY on the ‘Task’ created from ‘Meeting’ → Not working.

chrome 2024-07-16 T21.39.23.553
(GIF 2)

Next steps

Note that [Venture] on the task table is the same field in both gifs. (See that it uses the same ‘Value for new rows’ formula.) The only difference is the first example is created from a ‘Contact’ and the second is created from a ‘Meeting’.
This is so puzzling as the ‘Value for New Rows’ formula is successfully auto-filling when created from a ‘Contact’ but not from a ‘Meeting’. I suspect there is an invisible order that these fields are calculated but I cant know for sure.

I believe the solution should be a fix to the timing of the ‘Values for new rows’ formula.

Any ideas?

Wow! I just figured it out!

It has to do with the difference between

  • Relation
  • Linked Relation

And it turns out the order matters!

In the above post the ‘Meetings’ record [Related Task] column was a ‘Relation’ column.
This was GIF 2 and it did not work.


(Image 1)

However, if you go to the ‘Task’ table and on the [Related Meeting] column click the option “Switch relation and linked relation” it seems to make it work!


(Image 2)

This changes what we see in Image 1 to say ‘Linked Relation’ instead of ‘Relation’.


(Image 3)

Now see the same test used in GIF 2 now has a different result. It successfully auto fills the [Venture] field.
chrome 2024-07-16 T22.14.31.476
(GIF 3)

Next steps

This is a acceptable work around for me. Still, I welcome the advice of coda experts.

  1. Why does the behaviour change based on ‘Relation’ vs ‘Linked Relation’? and is this intended behaviour?
  2. Does anyone have anything to add to what I have discovered?