How to adding ID column to Json

Hello all

I have several questions hope someone can help>
So in order to get the 3 lastest records based on the specific date so I can compare the revenue with each other

  1. I did create this query to filter the revenue with year and month

    2.1. How can I get the 3 records above the record that have year =2022 and month =4
    2.2. Is there anyway to create a ID column to automatic fill the incremental number
    2.3. Is there anyway that I can synce that table to a googl sheet?

Thanks all <3,
An

Hi @An_Nguyen Thanks for reaching out! I think we need a bit more info here to give the best response

  1. What is SumDoanhThuSellIn_SumByMonth returning? Does it include the 3 records you're looking for?
  2. It looks like this query is a query JSON with SQL type. Are you looking to add the id column to your underlying resource? What is the resource type?
  3. Yes, you can connect Goole Sheets using our Integration and then pass any table data to a spreadsheet https://docs.retool.com/data-sources/quickstarts/api/google/sheets You could also use JS to add an id column when passing the data to Google Sheets if needed. Here's one possible example: