Hello everyone,
I am working on integrating Appsheet with Vertex AI Studio. My goal is to have Appsheet save files to GCP Storage and then send a REST API call with information about which FILES should be analyzed. This API call would trigger a GCP Run Function to process the files using Vertex AI Studio.
However, I am encountering an issue where I can only send information about one file per request.
Has anyone faced a similar challenge or have any advice on how to handle multiple files in a single request?
I appreciate any guidance you can provide.
Thank you!
Solved! Go to Solution.
And even better solution that take care of inconsistency of data.
[
<<If: COUNT(FILTER("My Files", ([To process] = TRUE))) > 1>>
<<Start: TOP(ORDERBY(FILTER("My Files", ([To process] = TRUE)), [_ROWNUMBER], TRUE), COUNT(FILTER("My Files", ([To process] = TRUE))) - 1)>>
{
"name": "<<[Name]>>",
"file": "<<[File]>>"
},
<<End>>
<<EndIf>>
<<Start: TOP(ORDERBY(FILTER("My Files", ([To process] = TRUE)), [_ROWNUMBER], FALSE), 1)>>
{
"name": "<<[Name]>>",
"file": "<<[File]>>"
}
<<End>>
]
After long time in documentation I found it. Solution for this question is automation bot, with webhook that use body template for JSON format that looks like this:
[
<<Start:SELECT(My Files[Row ID], [To process] = TRUE)>>
{
"Name": "<<[Name]>>",
"Description": "<<[Description]>>",
"UploadedAt": "<<[UploadedAt]>>",
"File": "<<[File]>>",
"Category": "<<[Category]>>",
"File Type": "<<[File Type]>>"
},
<<End>>
]
This allows to send multiple rows in one request.
And even better solution that deals with comma at the end.
[
<<If: COUNT(SELECT(My Files[Row ID], [To process] = TRUE)) > 1>>
<<Start: TOP(SELECT(My Files[Row ID], [To process] = TRUE), COUNT(SELECT(My Files[Row ID], [To process] = TRUE)) - 1)>>
{
"Name": "<<[Name]>>",
"Description": "<<[Description]>>",
"UploadedAt": "<<[UploadedAt]>>",
"File": "<<[File]>>",
"Category": "<<[Category]>>",
"File Type": "<<[File Type]>>"
},
<<End>>
<<EndIf>>
{
"Name": "<<[Name]>>",
"Description": "<<[Description]>>",
"UploadedAt": "<<[UploadedAt]>>",
"File": "<<[File]>>",
"Category": "<<[Category]>>",
"File Type": "<<[File Type]>>"
}
]
Good job!
And even better solution that take care of inconsistency of data.
[
<<If: COUNT(FILTER("My Files", ([To process] = TRUE))) > 1>>
<<Start: TOP(ORDERBY(FILTER("My Files", ([To process] = TRUE)), [_ROWNUMBER], TRUE), COUNT(FILTER("My Files", ([To process] = TRUE))) - 1)>>
{
"name": "<<[Name]>>",
"file": "<<[File]>>"
},
<<End>>
<<EndIf>>
<<Start: TOP(ORDERBY(FILTER("My Files", ([To process] = TRUE)), [_ROWNUMBER], FALSE), 1)>>
{
"name": "<<[Name]>>",
"file": "<<[File]>>"
}
<<End>>
]
User | Count |
---|---|
15 | |
13 | |
8 | |
7 | |
4 |