Auto Update Multiple Table Records Dependent on another Column Condition

Hi,

I have a goal of updating a Table Record (multiple) depending on the condition of another column. The application for this is a based test that needs to be conducted on our production floor every 2 hours from the last known test. Ex. user completes the test at 8am, the next test will need to be done before 10am otherwise the material can be considered suspect.

I have a table with a boolean column that checks “yes” when the test is completed through the app. I am stuck on creating the bot that will then go back and read each row and change the “yes” to a null or “no” value.

The table has a finite amount of rows, as it represents our production lines.

Column X is the one that needs to be changed, based on column “Datetime”

Here is what I started off with in the connector, but no luck

{
“table_name”:“uf2jbGB9DJ927c5Hf”,
“column_to_update”:“zwnfi_column_x”,
“new_value”:" “,
“condition_column”:“lnrht_datetime”,
“condition_operator”:”>",
“condition_value”:6200
}

Also
{
“zwnfi_column_x”: false,
“$expr”: {
“$gt”: [
{ “$subtract”: [ new Date(), “$lnrht_datetime” ] },
6200000
]
}
}

Any help or advice is appreciated, even if its that I am approaching this problem the wrong way

My instinct tells me you should rearchitect the solution to not require updating records multiple times but I can’t say for sure with the limited information.

One problem I see is that you can’t compare a Datetime stamp directly to an interval 6200.

From what I can tell you’ll either have to one of two things, which are really the same thing but just changes how you do the comparison:

  1. Find a way to get the current Datetime and then subtract the record Datetime so the result is an interval in seconds.
  2. Take the Record Datetime and add 6200 seconds to it so you can calculate the new Datetime for the comparison.

Hey Richard,

Thanks for the reply. I did find another solution that seems to be working smoothly.

I used the looper widget to make the adjustment to the table. For now, an application is running indefinitely on a station and making adjustments to the table on a timer interval