Pushing a button with newly created row

Hello Coda community!
I am posting here after having contacted the support as I’m creating a doc for internal and shipment tracking. What I’ve done so far:

  • I have a table with a list of shipment orders that a teammate needs to handle (with SKU, quantity, receiver…etc). It’s called ‘Orders to send’

  • I have a button ‘Request batch order’ where we can request a specific order to the teammate after which they will be notified by email with a specific message with a few details about what they need to send and to who.

  • I’d like the push of this button opens a window where we can fill the detail of the order and then it creates a new row. In this new row, I’ve created a button ‘Notify teammate’ which send the email to my teammate with the specific detail of the row newly created

  • After having read a few articles in the community, I tried a few things and it seems I can’t run with the same button the actions of opening the row for edition, creation of new row and pushing the button. So I have created a first table ‘Hidden data’. When ‘Request Batch order’ is pushed, it creates the row there and then said row is copied it in my main table ‘Orders to send’

  • Then I tried to create an automation so the button of the modified row(s) in ‘Orders to send’ are pushed except if the ‘Status’ column is not ‘Requested by team’ (so there are only notifications sent to my teammates when we request new shipment orders)

But! It’s not working ^^

  • The automation fails every time
  • I used the First() formula to copy each line created from ‘Hidden data’ to ‘Orders to send’ but only the first line created is copied properly in the table ‘Orders to send’. I tried Last() then but it’s not working and I have empty data every time.

Here is the sample of my document Copy of Package tracking

Thanks a lot for your help!

Hi @Minh-Tran_BUI
and welcome to Coda Community! :handshake:

I tried to provide and alternative solution (in the Alternative page) that I think might do the work.
It is also much more simpler, if the UX flow is consistent with your needs.

Basically, you give responsibility to the user to notify the colleague.
The notification button is accessible in the modal view but only if the mandatory fields are provided.

I over-simplified the use-case, but I hope it makes sense for you.
there is also an Is Batch column so that it’s easier to filter out batches not complete or not yet notified

Let me know if this could help.
Cheers!

1 Like

Thanks a lot Federico! More simple is perfect and it indeed reaches the objective I had in mind! :muscle:

So I also understand better (at least partially) what happened in the example i’ve created, do you have an idea concerning the issues with the last() function and the automation?

Thanks again :slight_smile:

1 Like

Hey @Minh-Tran_BUI
happy it worked! :slight_smile:

I’m not sure I really spot that Last() function… :grimacing:
Can you point me in the right place?