Appsheet using bot to update existing row column

I am creating a Form view, for users to clock in and out. All the data will be stored in a Google sheet "Staff" sheet.

I am facing a challenge. When user time-out with the form, the bot that I set up doesn't update the value to the existing time-in row. Instead, it has become a new row.

---Current (Wrong)---

Wrong Timesheet.jpg

---Expect---

Correct Timesheet.jpg

I have set up 2 action and 1 bot to write to existing row if there is a data change in "Staff" table. But it fail and below is the table, action and bot setting. May I know where went wrong?


This is my Staff Table setting: 

Staff Table.jpg

This is my Check Out Action: 

Check Out Action.jpg

Referenced Rows:

 SELECT(
      STAFF[_ROWNUMBER],
      AND(
        [Name] = USEREMAIL(),
        [Date] = TODAY(),
        [Branch] = [_THISROW].[Branch],
        ISBLANK([Time Out])
      )
    )

This is my Set Check out time Action: 

Set Check out time.jpg

Bot Setting 

Event Stesp.jpgProcess Check out.jpg

Event Condition:

Not(ISBLANK(
  ANY(
    SELECT(
      Staff[Time In],
      AND(
        [Date] = TODAY(),
        [Branch] = [_THISROW].[Branch],
        [Name] = USEREMAIL()
      )
    )
  )
))

This is the error message from the bot "Test" result:

Failed: Error: 'Execute an Action on a Set of Rows' Data action 'Check Out' for 
table 'Staff failed with exception Cannot get key values when Parent or ChangeImage are null. 

{
  "$type": "Nirvana.Data.TaskResultTakeAction, V2API",
  "AppWorkflowRuleOrProcessName": "Process for Auto Check-In/Check-Out - 2",
  "ActionName": "Check Out",
  "Changes": {
    "$id": "1",
    "$type": "ChangeOperations.Changes, ChangeOperations",
    "ListChanges": [
      {
        "$id": "2",
        "$type": "ChangeOperations.Change, ChangeOperations",
        "AfterImage": [
          "6",
          "eexxx@gmail.com",
          "05/18/2024",
          "TBP",
          "",
          "13:16:00",
          "336:00:00",
          "10",
          "",
          "",
          ""
        ],
        "AfterImageOriginal": null,
        "BeforeImage": null,
        "BeforeImageOriginal": null,
        "ChangeImage": null,
        "ChangeImageToLog": [],
        "ChangeImageSavedImages": null,
        "ProcessStateDataChange": null,
        "MustReadBeforeOrAfterImage": false,
        "OpTypePerformed": "Update",
        "TableName": null
      }
    ]
  },
  "AppErrors": {
    "$type": "Jeenee.DataTypes.AppErrors, Jeenee.DataTypes",
    "RecordInfo": false,
    "RecordWarning": true,
    "AnnotateErrors": false,
    "Errors": []
  },
  "TaskType": "TakeAction",
  "TaskName": "Check Out"
}
Solved Solved
0 1 723
1 ACCEPTED SOLUTION

Found the solution. I have change the Data Change Type to "Add" and condition to something simpler ISBLANK([_THISROW].[Time In])
Quan_W_0-1716031672237.png

 

View solution in original post

1 REPLY 1

Found the solution. I have change the Data Change Type to "Add" and condition to something simpler ISBLANK([_THISROW].[Time In])
Quan_W_0-1716031672237.png