Action: Add a Row to a Table

Actions are manual ways of interacting with your data, allowing app users to visit a URL, start a phone call, see a location on a map. Actions also allow for quick data changes, or creating a new row of data in the data table for which the Action is associated. Until Praveenโ€™s recent feature announcement, it was not possible to use an Action to add a row of data to a different table.

Now, by creating a new Action and specifying which separate table data should be added to, and defining each column added, rows of data can quickly be updated and moved across all tables in your application.

Start by visiting Behavior > Actions > 'Add New Actionโ€™

This setup shown below produces the effect of copying the Email and Course values from the student table, and using the TODAY() and TIMENOW() expressions, to log the Email, Course, current date and time as a new row in the attendance table:
2X_b_b7352d54548e86f9c9e13193bfb5f2a020b597dc.png

This example can be seen live in this Attendance Tracking application for the classroom. With a single Action click, student details can be logged for historical record:

12 21 6,933
21 REPLIES 21

Octfolio_Seb
Participant III

Thanks, @Peter! We have been achieving this using database triggers, the downside to this is that the user needs to be online for this to occur. Does this new functionality work offline?

Hey @Octfolio_Seb - yes this should work offline just like a data-change action or any other data add/update. It will sync the update once back online.

Oh Great!

I was using Google Apps Script for the same functionality.
So, now I can get rid of the script running at Google sheets.

Excellent new feature. We, too, have been using work-arounds for this.

I implemented the new action type and it works as expected, but consistently get the error message in the attached picture. If the user clicks the action again, it works fine. What is happening?

There is no row with that keyโ€ฆ

My experience is: You should newer use DateTime as your Key column. The best Key is always a Text column with UNIQUEID() as the initial value.
Especially in this situation it COULD happen that 2 users add a record at the same time. That would be rare, but possible. So you should not use DateTime as a Key.

if i group this together with an edit action(edit second), will i be editing the new row, or the original record?

MultiTech
Participant V

I see the bug with this new feature, mentioned in this post (3 weeks ago), still hasnโ€™t been resolved.

Any news on when initial value formulas will be able to make use of the values set by this action?

Peter_Bernsen
Participant III

Great functionality, I was waiting for this for my customer!

tcanelli
Participant V

Is this something that could be used to populate a call log table without the need to ref two tables?

hru
Participant V

Hi @Peter,

I was trying to copy your sample apps above, but could not do that. See snapshot below:

Iโ€™ve tried using my other AppSheet account also resulting the same.

I could not Look-Under-the-hood also. I can accept and see how to apps looks, but there is no โ€œhoodโ€ for me to open the Behavior>Actions to see what you have wrote in this initial post.

Let me know how to get the copy for me to learn about this โ€œAdd a Row to a Tableโ€.

Hi @Peter Thanks. I am able to copy the sample app.

BMAP
Participant I

Is the 2nd tableโ€™s Workflow โ€œUpdate Eventโ€ of โ€œADDS_ONLYโ€ triggered in the 2nd table upon the addition of a new row via this feature? Iโ€™m having troubles.

I have an audit app. Inspectors answer Yes or No to various questions. IF they record a โ€œNoโ€ as any answer, I want to trigger the app when synced to record this row to a row in another table.
I have an appsheet expression that looks at each column for the word โ€œNo.โ€ IF any of them are โ€œNoโ€, then my column name Errors is marked true.

When I follow the instructions above, under Behavior for the action, I typed in
AuditForm[Errors]=TRUE (also did with โ€œTrueโ€) and I get the following error message:

Cannot compare List with Yes/No in (AuditForm[Errors] = โ€œTRUEโ€)

Any help?

Please post a screenshot of the action configuration, and of any expressions used in it.

AuditForm[Errors] will return every entry for Errors from the table AuditForm, thatโ€™s why it is a list, you might wants just [Errors] if this is being checked on a single current row or a form of ANY(SELECT()) or ISBLANK(SELECT(AuditForm[Errors],[Errors]=True)) or something similar.

[Errors]=โ€œTrueโ€ worked perfectly.

Thank you.

Phong_Lam1
Participant V

Hi all, could It automatically adding new row another table when we adding row to this table without clicking at adding button ? thanks

Hi Phong, yes that would be a good use case for Automation, using a โ€˜Data Actionโ€™.

Hi @Peter, thank you,that is great. But any other way to workaround since we are using starter plan (If I am not wrong Bot required core plan).

Top Labels in this Space