F.A.Q.

How do I update the record status field via API?

  • 24 October 2023
  • 0 replies
  • 94 views
How do I update the record status field via API?
Userlevel 7

To update the status of a record via API, just follow the steps below.

👉🏼First you need to know the Status ID. The following query will give you this information:

{
  table(id: "XXXXXXXXXX") {
    statuses {
      name
      id
    }
  }
}
 

👉🏼Next, you will use the Status ID obtained to update the field of a record by executing the following mutation:

mutation {
  updateTableRecord(input: {statusId: XXXXX, id: XXXXXXXX}) {
    table_record {
      title
      status {
        name
      }
    }
  }
}

⚠To find out the record's ID, simply access the database and when you open the record identify the final number that appears in the browser's address bar.
 

Or via API by running the query below:

{
  table_records(table_id: "XXXXXXXXX") {
    edges {
      cursor
      node {
        id
        title   
      }
    }
    pageInfo {
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
  }
}


0 replies

Be the first to reply!

Reply