Create a query to update multiple columns by matching the value in the 'environment' column

I am trying to write that mutation query but not able to make it work.

the query should select the row based on the environment name and update the columns “remark” and “branch” with the values I will provide in the query.

I found we can update the column value using below query:

mutation {
  change_multiple_column_values(
    item_id: xxxxxxxx
    board_id: 1122334455
    column_values: "{\"status\" : {\"label\" : \"Done\"}, \"dropdown\": \"My label\" }"
  ) {
    id
  }
}

but in above query I don’t know the item_id. How can I have a query which will find the item_id by matching the column ‘environment’ with ‘test’

Hello there @vrathore and welcome to the community!

I hope you like it here :muscle:

What would the “environment” be? The item’s name (first column)?

If so, you can use a query like this one:

{
  items_page_by_column_values(
    board_id: 1234567890
    columns: [{column_id: "name", column_values: ["test"]}]
  ) {
    items {
      id
      name
    }
  }
}

I hope that helps!

Cheers,
Matias

@Matias.Monday
Thank you for your assistance, but my objective is to accomplish a different task. I have attached a snapshot for clearer understanding.

What I aim to achieve is to update the ‘Tag’ and ‘Branch’ columns with specific values if the item is labeled as ‘Test’. To accomplish this, I believe I need to write a mutation query that will check the item’s value and then update the corresponding ‘Tag’ and ‘Branch’ columns.

Hello there @vrathore,

You will need the query to get the item ID of the item that has that name, and then you can use a mutation as explained here (example here) to change the column values :grin:

Cheers,
Matias

1 Like