How to send request throught webhook with data from multiple records?

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 Solved
0 4 230
1 ACCEPTED 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>>
]

View solution in original post

4 REPLIES 4

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]>>"
    }
]

Thx to https://www.googlecloudcommunity.com/gc/AppSheet-Q-A/In-a-workflow-s-JSON-format-how-can-I-use-AppSh...

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>>
]