Is there a way to send only few rows in glide api get response?

Hi Guys,

I have a table → when I click on show API → Curl → Get rows

it currently gives me list of all items in the table.

In my table I have a column called FetchData

Only when the value for it is true I need that Items to be shown in the response.

how can I achieve this?

Thank you in advance

Regards,
Dilip

That can only be done with Glide Big Tables.

Thank you for responding @Darren_Murphy

Can we have combination of Glide tables and Glide big tables in a project? Mixing is a good practice?

Regards,
Dilip

Yes, you can do that.

Hi @Darren_Murphy I will give it a try.

If I complete migration to Big tables how can I filter out to get only certain values?

Regards,
Dilip

1 Like

Thank you for sharing @Darren_Murphy

Will go through this.

Regards,
Dilip

Thank you for sharing @Darren_Murphy

Will go through it .

Regards,
Dilip

Hi @Darren_Murphy ,

Is this a valid query for me to just filter data from my Glide Big Tables to fetch only rows which has FetchData is true?

curl --request POST ‘https://api.glideapp.io/api/function/queryTables
–header ‘Content-Type: application/json’
–header ‘Authorization: Bearer *********************’
–data-raw ‘{
“appID”: “”,
“queries”: [
{
“tableName”: “”,
“utc”: true
SELECT * FROM “native-table-4ed” WHERE “FetchData” = TRUE;
}
]
}’

Let me know wether this is right way?

Regards,
Dilip

That doesn’t look right. You need to use the internal column names that Glide assigns.
Refer to the example in the documentation.

Hi @Darren_Murphy ,

I just checked it and this is what I could do

curl --request POST ‘https://api.glideapp.io/api/function/queryTables
–header ‘Content-Type: application/json’
–header ‘Authorization: Bearer *********************’
–data-raw ‘{
“appID”: “”,
“queries”: [
{
“tableName”: “native-table-426a619e-53ac-4f20-918e-6d4ffa5cd4ed”,
“utc”: true
“sql”: “SELECT * FROM "native-table-426a619e-53ac-4f20-918e-6d4ffa5cd4ed" WHERE "CreatorName" = $1 AND ("IGHandle" = $2 OR "FetchData" = $3)”,
“params”: [“FetchData” = true]
}
]
}’

Now I am not sure how can I check send data of FetchData column value is true.

Could you let me know?

Regards,
Dilip

A few things:

  • Assuming that FetchData is the correct internal Glide column name (I’m still skeptical about that) and it is a boolean type, then you don’t need to use a parameter replacement. You can just directly test for TRUE/FALSE/NULL.
  • Also, you need to be quoting the column names (this is explained in the documentation).
  • Thirdly, you have defined 3 replacements ($1, $2, $3), but you are only passing one parameter - which is being passed incorrectly. Again, please refer to the example in the documentation.

Hi @Darren_Murphy ,
Thank you for clearing it

I guess I get it now. I was doing it wrong

“queries”: [
{
“sql”: "SELECT * FROM "native-table-W6X94ehhihDbnGdSCKib" WHERE backslash “RnIes backslash” IS TRUE ]
}’

RnIes ----> is internal glide table name which is of boolean in my case

Let me know if this is ok.

For some reason I am appending them within Quotes but they are going off because of editor formatting I guess.

Regards,
Dilip

Regards.
Dilip

Hi @Darren_Murphy ,

Thank you for your help and support

“queries”: [
{
“sql”: “SELECT * FROM "native-table-426a619e-53ac-4f20-918e-6d4ffa5cd4ed" WHERE "RnIes" = TRUE”
}
]
}

I got it to work using this query

Regards,
Dilip

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.