Adding a Row Via the Table "Add Row" Function

I am attempting to add the ability to add a row directly from the table. I already have editable cells and created a query to do a bulk update. I have read that you can use the same query to add the row as well.

Can somebody explain exactly how you do that?

1 Like

I would also like to know, especially since editing cells is enabled and the user should be able to add a row right from the table

not sure if this what you need

  1. Select Table
  2. Open Inspector
  3. Go to Add-ons
  4. Select Toolbar
  5. Add Toolbar Button
  6. Add row

image

@adigunawan, thanks for the reply, however, what I was wanting to know is, if editing cells is enabled, how do you go about adding the data for the new row. I keep getting the error that there is no ID # even though the database is set to auto-incrementing for the id.

Is anyone able to answer this question?

Hey Tomm,

You need to use the newRows object that is available in your table. However, most likely you will need to use a separate query than the one you are using for the bulk update.

Here's an example from another user. Or this one that actually uses the same Upsert query for both edit changes and new rows.

I hope this helps!

P.S. Sorry for not getting back to your DM yet, have been extremely busy lately

Hey @MiguelOrtiz. I can understand using a separate query from the one for bulk updates, but I don't understand how to make edit use one query and insert use another.

Hi Tomm,

In your event triggers you can add a condition. For example, for new Rows:

image

You select the query and a "only run" condition that checks if newRows has more than one record .

The same will apply for your bulk update query, but this time with changesetArray, i.e.

image

3 posts were split to a new topic: "cannot cast type boolean to date" sql error