# Issue with Call-API in the Data-Editor

**URL:** https://community.glideapps.com/t/issue-with-call-api-in-the-data-editor/78870
**Category:** Ask for Help
**Tags:** api, actions
**Created:** [December 31, 2024, 6:31am UTC](https://community.glideapps.com/t/issue-with-call-api-in-the-data-editor/78870 "2024-12-31T06:31:21Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Bernd\_Grimm](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/bernd_grimm/32/81073_2.png) [@Bernd\_Grimm](https://community.glideapps.com/u/Bernd_Grimm)
#### Post date: [December 31, 2024, 6:31am UTC](https://community.glideapps.com/t/issue-with-call-api-in-the-data-editor/78870/1 "2024-12-31T06:31:21Z")

</div>

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:  
https://www.loom.com/embed/badcde2169f14cd7b85ab8022f905d71?sid=10c67d23-d6c9-4df0-bf0f-dc9856425128

Thank you very much!

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [December 31, 2024, 6:47am UTC](https://community.glideapps.com/t/issue-with-call-api-in-the-data-editor/78870/2 "2024-12-31T06:47:20Z")

</div>

Can you show the configuration of the below two columns:

 ![CleanShot 2024-12-31 at 14.44.58@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/8/f871227320120c15ab7a6367a8c0e91d8c67a4e2.png)

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_

---

<div class="post-metadata">

### Author: ![Bernd\_Grimm](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/bernd_grimm/32/81073_2.png) [@Bernd\_Grimm](https://community.glideapps.com/u/Bernd_Grimm)
#### Post date: [December 31, 2024, 7:01am UTC](https://community.glideapps.com/t/issue-with-call-api-in-the-data-editor/78870/3 "2024-12-31T07:01:03Z")

</div>

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

 ![Bildschirmfoto 2024-12-31 um 07.58.19](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/e/4e2b6bcecbb1c4ca3ebf1ca16faea8a207fb259e.png)

 ![Bildschirmfoto 2024-12-31 um 08.07.47](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/5/9596049961b311bba0c01ed0e168f8cf75498346.png)  
this crashed my head yesterday

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [December 31, 2024, 8:11am UTC](https://community.glideapps.com/t/issue-with-call-api-in-the-data-editor/78870/4 "2024-12-31T08:11:01Z")

</div>

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:

```auto
{
  "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.

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [December 31, 2024, 8:41am UTC](https://community.glideapps.com/t/issue-with-call-api-in-the-data-editor/78870/5 "2024-12-31T08:41:44Z")

</div>

@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/embed/b6eaba1707e44af68fb52827d4f4aa31

[https://www.loom.com/share/b6eaba1707e44af68fb52827d4f4aa31](https://www.loom.com/share/b6eaba1707e44af68fb52827d4f4aa31)

---

<div class="post-metadata">

### Author: ![Bernd\_Grimm](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/bernd_grimm/32/81073_2.png) [@Bernd\_Grimm](https://community.glideapps.com/u/Bernd_Grimm)
#### Post date: [December 31, 2024, 8:47am UTC](https://community.glideapps.com/t/issue-with-call-api-in-the-data-editor/78870/6 "2024-12-31T08:47:05Z")

</div>

Great Darren. Thanks a lot - i will digg into this.

---

<div class="post-metadata">

### Author: ![Bernd\_Grimm](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/bernd_grimm/32/81073_2.png) [@Bernd\_Grimm](https://community.glideapps.com/u/Bernd_Grimm)
#### Post date: [December 31, 2024, 12:18pm UTC](https://community.glideapps.com/t/issue-with-call-api-in-the-data-editor/78870/7 "2024-12-31T12:18:41Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [December 31, 2024, 1:03pm UTC](https://community.glideapps.com/t/issue-with-call-api-in-the-data-editor/78870/8 "2024-12-31T13:03:13Z")

</div>

Excellent, glad you got it working!  
And a Happy New Year to you as well 🥳

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)
#### Post date: [January 7, 2025, 1:03pm UTC](https://community.glideapps.com/t/issue-with-call-api-in-the-data-editor/78870/9 "2025-01-07T13:03:29Z")

</div>

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