Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk3 min

Build a CRUD App with a JavaScript Grid, Node.js, and DynamoDB: Part 2—Add and Delete

Extend a read-only product grid with server-side create and delete actions using Lattice Grid, a Node.js Lambda function, and DynamoDB.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This installment extends a read-only product grid with create and delete actions. Lattice Grid collects product details and sends them to a Node.js function through an AWS Lambda Function URL; the function performs the DynamoDB writes. The example is Tony Goodchild’s tutorial implementation, which requires Lattice Grid 1.76.0 or later—not an independently tested deployment.

What Part 2 adds

The example builds on Part 1’s product-list application. Part 1 created the DynamoDB table, Lambda function, and read-only page; Part 2 adds products using the grid’s row form and deletes them from a row context menu. The tutorial’s code is in the part-2 folder of the tutorial repository.

As an Amazon Associate I earn from qualifying purchases.

The browser does not write directly to DynamoDB. It sends HTTP requests to a Lambda Function URL, and the Node.js function carries out the database operations. That separation keeps database access in the server-side function, although the sample endpoint itself has no authentication.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How adding a product works

  1. Collect the fields. The grid’s built-in row form gathers product details and invokes its create hook.
  2. Send the request. The page posts the form data as JSON to the Lambda Function URL.
  3. Validate and store. The function assigns a SKU if one was not supplied, stamps an updated date, and writes the product to DynamoDB. A condition prevents an existing SKU from being silently overwritten.
  4. Update the grid. The function returns the stored product, which the grid adds as a row.

The duplicate-SKU condition matters because it makes a conflicting create fail rather than quietly replacing an existing item. The server’s response also lets the grid display the saved record, including server-assigned values.

How deleting a product works

  1. Choose the row action. A context-menu action on a product row initiates deletion.
  2. Confirm. The grid asks the user to confirm before proceeding.
  3. Identify the item. The page sends a DELETE request containing the row’s SKU.
  4. Remove it after success. The grid discards the row only after the server reports that the delete operation succeeded. If the request fails, the row remains visible instead of disappearing from the interface while still stored in DynamoDB.

Configure the Lambda Function URL for browser requests

The tutorial says the Function URL initially allows only GET. Because the page also sends JSON POST and DELETE requests, update its CORS configuration to permit those methods and the content-type header. Otherwise, the browser can block the cross-origin request even if the function code and database permissions are correct.

Give the Lambda role the required DynamoDB access

Part 1 uses the AWS-managed AmazonDynamoDBReadOnlyAccess policy, which is not enough for create and delete. The tutorial replaces it with a table-scoped inline policy for the Products table. It lists scan, get, put, update, and delete permissions; update is included for the following installment. Scope permissions to the table the function needs rather than granting broad DynamoDB access.

For JavaScript projects, AWS’s DynamoDB guide for SDK v3 documents both the low-level client and the higher-level document client, and recommends using the latest SDK. Its examples show document-client put and delete operations. This is current AWS guidance for the SDK, not a verification of the tutorial repository’s dependency versions.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Security and scale limits to address before production

The sample URL is unauthenticated

The tutorial warns that anyone who has the Function URL can change products. CORS is a browser access control, not an authentication mechanism: it does not establish who is authorized to create or delete records. A production adaptation needs an authentication and authorization design appropriate to its users and data.

The page loads the full product list

The example returns every product on each load. The tutorial identifies server-side filtering, sorting, or paging as next steps for larger datasets. Those capabilities reduce the amount of data the endpoint must return and let clients request only the records they need.

Keep the create safeguard server-side

The duplicate-SKU condition is enforced by the DynamoDB write, rather than relying only on the grid to check for collisions. This is important because a client-side check alone cannot prevent another request from creating the same SKU between the check and the write.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.