How to Add a lower border under every last imported row of every new order?

Right now I have scenario THAT consists of 3 modules.

I would like to add a lower border under every last added row of every new order that comes in. For example , i have order with 2 unique product IDs = it will import 2 new rows of data about the order, and i want to have the last row with a lower border. If I have one unique product ID , then i would love to get a lower border under that one imported new row. How could I do it?

Hi @Veins_Seleckis,

It is currently not possible to do that through existing Modules in Make for GSheets, However, you can use the Make an API Call module of Google Sheets to achieve this.

And, This is the API that you need to use, batchUpdate in Google Sheets, with updateBorders the one that you are looking for.

Do let me know if you still need help with this? Give it a try and see how it goes.

The Request Body will looks something like this,

{
  "requests": [
    {
      "updateBorders": {
        "range": {
          "sheetId": 1504867547,
          "startRowIndex": 1,
          "endRowIndex": 2,
          "startColumnIndex": 0,
          "endColumnIndex": 6
        },
        "bottom": {
          "style": "SOLID_THICK",
          "width": 1,
          "color": {
            "blue": 1.0
          }
        }
      }
    }
  ]
}
1 Like

yeah i still need it, will take a look now!

can i add this api call module into this scenario?
and if yes , then , where?

could you also provide a photo of API module setting filled out please? im quite lost on how to use this module properly. sorry.

Ok, You can this attached blueprint to grab all the required details.

blueprint (37).json (57.2 KB)

So, You need to use the Make an API Call Module, which will look something like this,

With the request body as,

{
  "requests": [
    {
      "updateBorders": {
        "range": {
          "sheetId": 1504867547,
          "startRowIndex":  {{(5.rowNumber - 1)}},
          "endRowIndex": {{5.rowNumber}},
          "startColumnIndex": 0,
          "endColumnIndex": 10
        },
        "bottom": {
          "style": "SOLID_THICK",
          "width": 1,
          "color": {
            "blue": 1.0
          }
        }
      }
    }
  ]
}

And, the URL will be,

spreadsheets/{{5.spreadsheetId}}:batchUpdate

okay so i managed to copy everything, looks fine, but should I add the API to both of the routes from the router or only one of them?

Both of them, but since you want to add rows to the last entry only, i.e at the end of a specific order regardless of the number of products, what you need to do is add a filter in between,

filter being, If Number of Bundles equals to Bundle order position. Those two variables is available from Iterator.

1 Like

So I added a filter for both of them that looks like that
Screenshot_10

And the whole scene looks like this

what could be the problem here ?

Can you share me a screenshot of what your Body looks like in the last module?

1 Like

{
“requests”: [
{
“updateBorders”: {
“range”: {
“sheetId”: {{2.spreadsheetId}},
“startRowIndex”: {{(2.rowNumber - 1)}},
“endRowIndex”: {{2.rowNumber}},
“startColumnIndex”: 0,
“endColumnIndex”: 10
},
“bottom”: {
“style”: “SOLID_THICK”,
“width”: 1,
“color”: {
“blue”: 1.0
}
}
}
}
]
}

It is because of sheetID, it is not as part of the response from the initial Add a Row module in Gsheet. It needs to be hardcoded for now and you can grab the sheetID by opening google sheets.

#gid=1504867547

You need to copy the value of gid from the URL and then use that in the scenario.

1 Like

so in my case its ‘‘0’’ :smiley:

1 Like

Yeah, By default it will be zero.

2 Likes

awesome, it works now, i jst need to set the bottom border line to be just black and little bit in bold, not blue . ^^

there is just one thing. that bottom border line didnt go all the way to the left, it stopped at J cell, why could that be?

For that, change the value of “endColumnIndex”: 10 to higher value to which your columns end. For eg, it it is Z then use 26

2 Likes

dude you are a fkking legend. thanks a lot. I just have one last thing for now that i would like to set up.

1 Like

If it is for black color, what you can do is set,

    "blue": 0,

Not sure if the color is needed at all, but just set it to 0.

1 Like