New Action: Add a Row to a table

We just added an initial version of a new action โ€˜Data: add a new row to another table using values from this rowโ€™

Please try it and give us feedback. Documentation, etc coming later this week. The brief version is here: letโ€™s consider an example with Orders and OrderDetails as two related tables in an app.

  1. Add an action โ€˜CreateChildRowโ€™ to the Orders table that will add a row to the OrderDetails table. You can specify expressions to assign to each column of this row. For example: Order = [Order Id], Product = โ€œBananasโ€, Quantity = 5. Note that [Order Id] here is the value of the column OrderId in the Order row on which the action is being performed.

  2. Use this action in the UI, or compose it with another action, or use it in a workflow rule when a new Order is created, etc.

Any columns not defined will get their initial values or app formulas. If a required column is not specified and does not have an initial value, you will be shown an error in the editor.

47 119 20.3K
119 REPLIES 119

2X_2_218c8ddc7b2d5b62b1331e2c5c9b757ff0ac36c1.gif

Amazing functionality!

Iโ€™m trying to check it.

When I define the another table (included already in the app, but different structure), in the option โ€œSet these columnsโ€ I can see only 2 columns from another table :-(, not all of themโ€ฆ What could be the reason?

regards!

Radoslaw

Hi @praveen! Iโ€™ve been using it and have found it to be extremely useful, powerful, and stable. I have, however, found something that may be a minor glitch. In my app, right after my โ€œAdd rowโ€ action is invoked, if I navigate to a table view that displays that table, I see this:

The row that begins with โ€œ9/5โ€ and all those below it were there before the new row was added. The top row is the one that was just added (the table is ordered to display in descending order). Itโ€™s the second row that is the problem. Fortunately, this row only appears temporarily, until the sync is complete. Then I see this:

This is not a major problem for me but if itโ€™s something that can be resolved easily, that would be nice.

If someone at AppSheet would like to have a look at my app, the name is 190701KankakuV5-230844 and the menu from which the โ€œAdd rowโ€ action is invoked is โ€œSessionโ€ (a primary view). If you tap on the โ€œNEXT SESSIONโ€ arrow and then navigate to โ€œMy Progressโ€ (a menu view; I may change the name and location in a day or two), you should be able to observe the phenomenon. Thanks!

Interesting! Will investigate

Is there a way to invoke this action but also go straight to an edit form of this new row of data? My scenario requires duplicating an existing row, but omitting an existing mandatory field and requiring the user to input a new value for that mandatory field. At the moment if I try to accomplish this with the new action, itโ€™s trying to enforce the mandatory aspect of that field (So I canโ€™t push a blank value of that column).

Instead of copy-and-edit, use LINKTOFORM() to create new with prepopulated column values.

Thanks Steve, wasnโ€™t aware this would serve the purpose I was chasing. Just implemented then into my app, working a charm!

How do I add a record to the same table without opening a form?

I recommend that you study this app:

Can you please indicate which page lists all the current resources relating to this feature including any videos and examples? Are good postings on this topic included there, e.g. how someone used it in a complex manner?
?

Hii Praveen โ€ฆ But one issue is there that some columns are not available in the List those who contain Formulas or REF column

Has anyone had the issue of the data of an image not being copied over to the table?

All the data is being transferred as it should (text/datetime etc.) but not image columns.

Any ideas?

Hi @Chris_Jeal

Not entirely sure if this is the same. But Iโ€™ve found you canโ€™t seem to use a text string in speech marks as an inital value for an image. It seems you have to create a formula to pull the same from somewhere else.

I have had this issue. I believe it is because the image is originally stored in a folder in your database (maybe google drive or dropbox), and when you add a row to another table, the image is still in the original google drive folder, and not in the new image storage folder, so it doesnโ€™t show.

Personally, I wish appsheet would put all images in 1 folder, to eliminate the hassle.

You can make this happen manually, each image column has a space where you can specify where it should send itโ€™s images; this overrides the default.

Smart solutionโ€ฆ

Jenner
New Member

Is there a similar action to UPDATE a row to another table using values from this row ?

Yes, you use the one that executed a series of actions on a set of s
Rows

Hi @Jenner,

No, but there is a feature request for it that you can vote for here:

The order id on Table A (copied from) needs to be the same as the order id on table B (copied to), how do I do that since Im starting my action on table A?

I have several order ids on table B, but would want to copy into the last updated copied ID on table b, what expression can I use?

If the Order ID is the key column, you can use MAXROW(โ€œTableBโ€,"_rownumber")

Is it possible to open the detail view of the newly created row of child table after adding automatically using grouped action ?

you are asking about the same subject in principal. Please refer to my post I just placed for other post. You simply change the name of view to direct to detail view instead of form view.

Thats Amazing!

Hello ,

I have 2 tables - JOB (Parent) and a JOB_ORDERS (Child) . In the JOB, I have a column to select multiple Orders populated using a multi select enum dropdown . So this field might have 1, 2 or many orders ID. I want to create one row for all the order IDs in that list , to be added to JOB_ORDERS . It will take the following fields from the JOB TABLE ( JOB ID, Order ID and other relevant fields). How do I do that ?

I have used the action on Attendance, but when I press the action it replaces row data with new ones instead of adding a new row.
If I go to attendance view I only see a recent attendance, no history. Any help?

Any chance that you have the same key value?

Not sure. I am using the username as the key column and the values are different on each row!
The expressions are clear on the action and the view option on the attendance view. Anything I can do?

By using username as the key value, you will only be allowed to have a single row per username.

You have two options:

  1. Check the key property for these three columns - Username, Date, Time. AppSheet will automatically create a virtual column named Computed_Key and use that as the key column. The down-side is that this virtual column could be re-calced on each Sync - an unnecessary activity.
  2. Instead, I would recommend adding a NEW column named something like Attendance ID and have it assigned with UNIQUEID() in the Initial Value property.

You can then leave everything else the same. The key column would be automatically filled in with a unique value each time the action is called and you will see a new row each time.

Thank you,
Option one worked straightforward. I am stuck with option two.

  1. I added a new column (Attendance ID)
  2. Assigned UNIQUEID() to initial value in both tables
    Didnโ€™t work

I tried to define it in the action. didnโ€™t work either. i just get the same row
Anything I can try?

Sorry, I didnโ€™t explicitly state that you want to set this new Attendance ID column as the Key column. Uncheck, any other columns set as the key. Check only the Attendance ID column as the key. Test that new rows are added.

Once you have verified this works and new rows are created as you need, AND this is the option you decide to go with, then delete any Computed_Key columns that might have been added.

Its Okay,
Using attendance ID as a key makes the studentsโ€™ view disappear.
It also changes only one row with data for a logged student (if the key is to one table).
3X_2_3_23211e8963914e2812615e74a5bf9c4a809b7f79.png

I will keep trying while using the other option though. Any advice

I donโ€™t know the details of your app so couldnโ€™t guess why this might have happened EXCEPT, if you have already pre-existing rows with Ref columns to your Attendance table, that Ref value will need to be updated to the value from the new Key column.

I donโ€™t know what this means.

I will keep working on it for some time. If I find anything interesting I will share. Just one thing.
I am proceeding with option one (the computed key) but if I get option two right, will I be able to change to option two without affecting the app functionality?

There shouldnโ€™t be any need to change app functionality but you may need to update data rows.

Any pre-existing rows would need to be updated with an appropriate Key value. You can do this in the sheet itself - even for UNIQUEID() values. See article below.

If you have any REF data type columns (not the REF_ROWS function) to the Attendance table, these will also need to be updated with the proper key - which is true for ANY option where you have changed the Key value.

I will keep checking. Thank you


What i did

But in this onle one rows will be added but i wanted to transfer of many rows from a table which is created