Hi guys,
I would like to build a document management system with glide.
There should be the possibility to upload receipts via mail and via BulkUpload up to 10 receipts via the Glide UI.
I have created a helper table that makes the individual receipts available from the receipt array.
Since I use the user table, the helper table should only have a temporary function. The documents should then be moved to a document table via the call API.
So much for the background.
Now I have the call API function with the mutation “add-row” of the Glide API in the helper table.
My action should now work in such a way that the document array is written to the user table during the upload, then the documents are broken down in the helper table and then saved to the “correct” table via API.
The problem is that the call API function does weird things. That means it adds rows randomly.
here is a small demonstration of the Problem:
Thank you very much!
Can you show the configuration of the below two columns:
It seems to be that you are going about this the wrong way. Instead of trying to add rows via the API from the Data Editor, it would be much better to prepare the JSON payload in your helper table (filtering out the empty rows), and then send it via a Call API action
yeah - i think so but therefore i considered to use this “if” column, to filter out only the lines, where the lineItem is not empty
this crashed my head yesterday
Yeah, that’s your problem. Call API is still running for every row, posting a body in most cases of “no api”, and that’s why you’re getting all those errors.
You need to move your Call API step into the workflow.
Here is what I suggest:
- Change your json column so that it just returns a single mutation.
- Add a Query column that targets your helper table and filters where LineItem is not empty
- Do a Lookup through that Query, targeting the json column. This will give you an array of mutations for the non-empty rows
- Feed that into a JSON Template column, adding the appID. It should look something like this:
{
"appID": $appID,
"mutations": $mutations
}
- Replace
$appID
with your App ID, and $mutations
with the Lookup column.
- Use that in a Call API step in your workflow. This will send a single API call to the Glide API, with just the rows you need added.
You don’t need all that other nonsense - writing to the User Profile row and clearing values, etc.
2 Likes
@Bernd_Grimm - as it so happens I have been working on something very similar today. Here is a loom that might help explain the steps I described above.
https://www.loom.com/share/b6eaba1707e44af68fb52827d4f4aa31
3 Likes
Great Darren. Thanks a lot - i will digg into this.
hey @Darren_Murphy,
works great - very cool approach. Thanks a lot!
I wish you a happy new year.
I’m already looking forward to everything 2025 with glide
1 Like
Excellent, glad you got it working!
And a Happy New Year to you as well