How to Push Revel Inventory Counts into NetSuite for COGS Reporting

Build a Spojit workflow that runs every night, reads on-hand stock levels per Revel location, and upserts the quantities and valuations into NetSuite records so your finance team can report cost of goods sold.

What This Integration Does

Restaurant and retail finance teams need accurate on-hand inventory in NetSuite to calculate cost of goods sold, but the live stock count lives in the Revel point-of-sale system. Keying those numbers across by hand at month end is slow and error-prone. This workflow closes that gap: it pulls current stock from Revel for each location, computes the on-hand quantity and valuation, and writes those figures into NetSuite on a nightly cadence so COGS reporting always works from fresh data.

The workflow is driven by a Schedule trigger, so no person has to start it. Each run reads Revel inventory with the Revel connector, totals quantities and value with the Math connector, and pushes each line into NetSuite with the NetSuite connector using an upsert keyed on a stable external ID. Because the write is an upsert, re-running the workflow (a retry, a manual run, or the next night) updates the same NetSuite records instead of creating duplicates, so the data is always a current snapshot rather than a growing log.

Prerequisites

  • A Revel connection with permission to read stock and product resources. See the Revel Systems connector reference to set this up.
  • A NetSuite connection with permission to read items and create or update your target inventory records. See the NetSuite connector reference.
  • The Revel establishment (location) IDs you want to sync, and a NetSuite record type and external-ID scheme to upsert into (for example a custom record per item per location).
  • A mapping from Revel product IDs to NetSuite item IDs, so each on-hand count lands on the right item.
  • The Math connector is built in and needs no connection.

Step 1: Add a Schedule trigger for the nightly run

Create a new workflow and set the Trigger node type to Schedule. Add a 5-field cron expression and an IANA timezone so the run lands after the trading day closes. For example, run at 2:00 AM Sydney time every day with cron 0 2 * * * and timezone Australia/Sydney. A single Schedule trigger can hold more than one schedule if you operate across regions. The trigger output is { scheduledAt }, which you can reference downstream as {{ scheduledAt }} to stamp each NetSuite write with the run time.

Step 2: Read current stock from Revel per location

Add a Connector node in Direct mode, choose the Revel connector, and select the list-inventory tool. This returns current stock levels. Set establishment to the location ID you want to sync, and use limit and offset for pagination. If you sync several locations, wrap this step in a Loop node (ForEach) over your list of establishment IDs and read one location per iteration.

{
  "establishment": 4821,
  "limit": 200,
  "offset": 0
}

To enrich each stock line with a price or product name for valuation, add a second Direct mode Revel step using get-product (or list-products) and map the product ID from the stock line.

Step 3: Loop over each stock line

Add a Loop node set to ForEach and point it at the list of stock items returned in Step 2 (for example {{ revel_inventory.data.items }}, matching the field your Revel step produced). Inside the loop body you will compute the valuation and write one NetSuite record per item. Iterating one item at a time keeps each NetSuite write small and lets a single bad line fail without losing the whole batch.

Step 4: Compute on-hand valuation with the Math connector

Inside the loop, add a Connector node in Direct mode using the Math connector. Use the calculate tool to multiply the on-hand quantity by unit cost to get a line valuation, referencing the looped item with handlebars such as {{ item.quantity }} and {{ item.unitCost }}.

{
  "expression": "{{ item.quantity }} * {{ item.unitCost }}"
}

For a run-level total across all lines, collect the per-line values and use the Math sum tool after the loop, then use currency or round to format the figure for reporting. See the Math Tools reference for the full tool list.

Step 5: Upsert the count and valuation into NetSuite

Still inside the loop, add a Connector node in Direct mode, choose the NetSuite connector, and select upsert-record. This creates or updates a record keyed by its external ID, which is what makes the workflow safe to re-run. Set recordType to your target record type, build a deterministic externalId from the location and item (so the same item at the same location always maps to one record), and put the quantity, valuation, and run timestamp in the body.

{
  "recordType": "customrecord_inventory_snapshot",
  "externalId": "revel-4821-{{ item.productId }}",
  "body": {
    "custrecord_location": "4821",
    "custrecord_item": "{{ item.netsuiteItemId }}",
    "custrecord_on_hand_qty": "{{ item.quantity }}",
    "custrecord_on_hand_value": "{{ line_value.data.result }}",
    "custrecord_snapshot_at": "{{ scheduledAt }}"
  }
}

Map custrecord_item using your Revel-to-NetSuite item mapping. If you need to confirm an item exists in NetSuite before writing, add a Direct mode get-item or list-items step and gate the upsert with a Condition node.

Step 6: Send a nightly summary email

After the loop completes, add a Send Email node so finance knows the snapshot landed. It sends from Spojit's built-in mail service, so no connection is needed. Set Recipients to your finance distribution list, a templated Subject such as Revel inventory snapshot for {{ scheduledAt }}, and a Body that includes the line count and the total valuation you summed in Step 4. Set If sending fails to Continue anyway so a mail hiccup never marks an otherwise successful sync as failed.

Tips

  • Page through Revel results: list-inventory defaults to a small page, so raise limit and increment offset in a loop until a page returns fewer rows than the limit.
  • Keep the externalId deterministic (location plus item) so retries and the next night's run land on the same NetSuite record instead of creating duplicates.
  • Format money with the Math currency or round tool before writing, so NetSuite receives clean numbers rather than long floating-point values.
  • Ask Miraxa, the intelligent layer across your automation, to scaffold the loop and the upsert mapping for you, then fine-tune the field names in the properties panel.

Common Pitfalls

  • Timezone drift: a cron like 0 2 * * * in the wrong IANA timezone can read stock mid-service. Match the timezone to each location's trading hours.
  • Missing item mapping: if a Revel product has no NetSuite item, the upsert can write an orphan record. Gate the write with a Condition node that checks your mapping resolved.
  • Unit cost gaps: products without a unit cost produce a zero or blank valuation. Default missing costs and flag them in the summary email rather than silently writing zeros.
  • Permission scope: a Revel or NetSuite connection without read-or-write permission on the relevant records fails the step. Confirm scopes before enabling the schedule.

Testing

Before turning on the schedule, validate against a single location and a handful of items. Temporarily cap the Revel step with a small limit, or filter to one product, and point upsert-record at a test NetSuite record type. Use the Run button to execute manually, then open the execution log to confirm the stock read, the Math valuation, and the NetSuite upsert each succeeded with the values you expect. Run it twice and verify the second run updates the same NetSuite records (no duplicates). Once the small scope is correct, widen the Revel limit, point the upsert at your production record type, and enable the Schedule trigger.

Learn More

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.