# Custom Action Error

**URL:** <https://forum.adalo.com/t/custom-action-error/12530>\
**Category:** External Collections, Custom Actions & Collections\
**Created:** [May 13, 2021, 5:29am UTC](https://forum.adalo.com/t/custom-action-error/12530 "2021-05-13T05:29:05Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![dominiconorton](https://avatars.discourse-cdn.com/v4/letter/d/8e7dd6/32.png) [@dominiconorton](https://forum.adalo.com/u/dominiconorton)\
**Post date:** [May 13, 2021, 5:29am UTC](https://forum.adalo.com/t/custom-action-error/12530/1 "2021-05-13T05:29:05Z")

</div>

Custom Action Support

I’m attempting to render data from an API and send that data to an email address when the user clicks send email on the item details screen

I do this using custom actions and Zapier

On the Zapier side, everything works fine. I use a catch hook and Gmail integration on a premium plan. This sends my test data to my email without a problem.

The live app has some issues. It doesn’t send the data. Zapier doesn’t even receive the request I believe because my Zap history is empty.

In Adalo:

1. I give the action a name and a “create” type
2. I give it a API Base URL from Zapier and post method, I give it inputs and the body JSON.
3. I run the test request and it is successful

Again, when I run the app live, it is not sending to Zapier. Where did I go wrong?

Here’s the app: [No Code Sports League](https://previewer.adalo.com/4053209f-4f7b-441e-b2f6-6a206172374c)

Attached images to show successful tests…

 ![Screenshot 2021-05-13 at 06.33.23](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/0/0a8f9224857a9853f50d4effbf4308c9701d7c54.jpeg)  
 ![Screenshot 2021-05-13 at 06.36.11](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/c/c56a8ee10ff3197e98c178274cf2d43f9dae7625.png)

Attached screenshots of the inspector…  
On the API request for the list data (even though it renders)…

 ![Screenshot 2021-05-13 at 07.59.06](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/d/df222575485206cd4394aa50ec3360c128d56c32.jpeg)  
On the request to Zapier to send the data of that list item…  
 ![Screenshot 2021-05-13 at 07.59.28](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/d/d5b5790e503ee106b3689fa27879c72dbd81f002.jpeg)

Recording…

---

<div class="post-metadata">

**Author:** ![anon78309838](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@anon78309838](https://forum.adalo.com/u/anon78309838)\
**Post date:** [May 13, 2021, 7:45am UTC](https://forum.adalo.com/t/custom-action-error/12530/2 "2021-05-13T07:45:45Z")

</div>

Hi,

What you can do to troubleshoot this yourself is to create a new collection internally in Adalo, name it whatever you want, then add all the properties that are also being sent to the custom action. Now, add a Create action after your custom action that records all the same details as the custom action itself.

You can then review the record created in Adalo to see if any data is wrong or missing entirely and then troubleshoot further why that might be the case

---

<div class="post-metadata">

**Author:** ![dominiconorton](https://avatars.discourse-cdn.com/v4/letter/d/8e7dd6/32.png) [@dominiconorton](https://forum.adalo.com/u/dominiconorton)\
**Post date:** [May 13, 2021, 8:21am UTC](https://forum.adalo.com/t/custom-action-error/12530/3 "2021-05-13T08:21:38Z")

</div>

Thank Colin,

I’ve made an update to the ticket.

I’m receiving the data from the API.

Zapier is not receiving the request from Adalo.  
The data of a particular item needs to be sent from Adalo to trigger a workflow

---

<div class="post-metadata">

**Author:** ![theadaloguy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/theadaloguy/32/8023_2.png) [@theadaloguy](https://forum.adalo.com/u/theadaloguy)\
**Post date:** [May 13, 2021, 10:40am UTC](https://forum.adalo.com/t/custom-action-error/12530/4 "2021-05-13T10:40:44Z")

</div>

Is there any multi line text in your data going to the API request? Multi line can break the json body.

---

<div class="post-metadata">

**Author:** ![dominiconorton](https://avatars.discourse-cdn.com/v4/letter/d/8e7dd6/32.png) [@dominiconorton](https://forum.adalo.com/u/dominiconorton)\
**Post date:** [May 13, 2021, 11:28am UTC](https://forum.adalo.com/t/custom-action-error/12530/5 "2021-05-13T11:28:54Z")

</div>

No,

The API request works in development during configuration but not production. I updated the ticket to show that with images.

---

<div class="post-metadata">

**Author:** ![theadaloguy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/theadaloguy/32/8023_2.png) [@theadaloguy](https://forum.adalo.com/u/theadaloguy)\
**Post date:** [May 13, 2021, 11:39am UTC](https://forum.adalo.com/t/custom-action-error/12530/6 "2021-05-13T11:39:47Z")

</div>

I don’t have access to your tickets, just pointing out a problem i’ve seen before.

---

<div class="post-metadata">

**Author:** ![theadaloguy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/theadaloguy/32/8023_2.png) [@theadaloguy](https://forum.adalo.com/u/theadaloguy)\
**Post date:** [May 13, 2021, 11:56am UTC](https://forum.adalo.com/t/custom-action-error/12530/7 "2021-05-13T11:56:49Z")

</div>

I can see your app and it very much looks like multi line data. Title is 2 lines, body is 6. You have many line breaks.

It might be worth testing if your zap works with single line data, to eliminate this as a possible issue.

---

<div class="post-metadata">

**Author:** ![dominiconorton](https://avatars.discourse-cdn.com/v4/letter/d/8e7dd6/32.png) [@dominiconorton](https://forum.adalo.com/u/dominiconorton)\
**Post date:** [May 13, 2021, 12:08pm UTC](https://forum.adalo.com/t/custom-action-error/12530/8 "2021-05-13T12:08:55Z")

</div>

Zapier is not even receiving the request from Adalo while live.

During setup, it works

That’s why I don’t understand what you’re suggesting. When I set it up it’s fine. When I test live Zapier doesn’t even receive the request.

If what you’re saying was the case why would the tests pass for both Zapier and Adalo in development.

---

<div class="post-metadata">

**Author:** ![theadaloguy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/theadaloguy/32/8023_2.png) [@theadaloguy](https://forum.adalo.com/u/theadaloguy)\
**Post date:** [May 13, 2021, 12:09pm UTC](https://forum.adalo.com/t/custom-action-error/12530/9 "2021-05-13T12:09:27Z")

</div>

Because your live data is usually different to your test data. I can’t see your test data, so just giving you an idea.

---

<div class="post-metadata">

**Author:** ![dominiconorton](https://avatars.discourse-cdn.com/v4/letter/d/8e7dd6/32.png) [@dominiconorton](https://forum.adalo.com/u/dominiconorton)\
**Post date:** [May 13, 2021, 12:23pm UTC](https://forum.adalo.com/t/custom-action-error/12530/10 "2021-05-13T12:23:25Z")

</div>

I’m exclusively using the API for data.

The same data is being used for test and prod. I’ve now added a recording.

The retrieving works fine. It’s send data to Zapier that’s a problem.

---

<div class="post-metadata">

**Author:** ![theadaloguy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/theadaloguy/32/8023_2.png) [@theadaloguy](https://forum.adalo.com/u/theadaloguy)\
**Post date:** [May 13, 2021, 1:08pm UTC](https://forum.adalo.com/t/custom-action-error/12530/11 "2021-05-13T13:08:04Z")

</div>

> [@dominiconorton](#):
>
> The same data is being used for test and prod

So you have a big multi line description when setting up custom action? Because if I try that, it says invalid JSON body.

[![]( " - YouTube") ](https://www.youtube.com/watch?v=awpmAHDNtK8)

So if you set up your custom action with a simple example phrase, but then on live try to send in lines of data, can you see why it might not work?

It would take you 30 seconds to change the data on your database to check if this is the issue.

---

<div class="post-metadata">

**Author:** ![theadaloguy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/theadaloguy/32/8023_2.png) [@theadaloguy](https://forum.adalo.com/u/theadaloguy)\
**Post date:** [May 13, 2021, 1:18pm UTC](https://forum.adalo.com/t/custom-action-error/12530/12 "2021-05-13T13:18:08Z")

</div>

Also I think an unrelated issue, but the data for title and description is different between the main list page and the details page after you click onto view details.

---

<div class="post-metadata">

**Author:** ![dominiconorton](https://avatars.discourse-cdn.com/v4/letter/d/8e7dd6/32.png) [@dominiconorton](https://forum.adalo.com/u/dominiconorton)\
**Post date:** [May 13, 2021, 1:27pm UTC](https://forum.adalo.com/t/custom-action-error/12530/13 "2021-05-13T13:27:48Z")

</div>

My workaround was to create a collection native to adalo. Instead of automating a zapier workflow directly from a button. It sends the data to the collection. Any new record added to the collection triggers the workflow in zapier

---

<div class="post-metadata">

**Author:** ![Victor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/victor/32/2054_2.png) [@Victor](https://forum.adalo.com/u/Victor)\
**Post date:** [May 13, 2021, 3:20pm UTC](https://forum.adalo.com/t/custom-action-error/12530/14 "2021-05-13T15:20:30Z")

</div>

Hi all,

Some time ago I’ve faced similar issue with data _working_ from test setup, but _not working_ from the actual app.  
In my case it was a QR code content comprised of several lines. The effect was the same - Integromat (in my case) didn’t receive anything and Adalo didn’t report any errors.

Moreover, it seemed to work with one “multiline” values and didn’t work with another ones. I didn’t have a lot of time to dig in deeper - which character causes this problem, I ended up getting the data the other way.

It would be nice to have some debugging capabilities in Adalo for such cases…

Just my 2 cents and for future searches, if someone stumbles upon similar problem 🙂

Best regards, Victor.

---

<div class="post-metadata">

**Author:** ![dominiconorton](https://avatars.discourse-cdn.com/v4/letter/d/8e7dd6/32.png) [@dominiconorton](https://forum.adalo.com/u/dominiconorton)\
**Post date:** [May 15, 2021, 11:50am UTC](https://forum.adalo.com/t/custom-action-error/12530/15 "2021-05-15T11:50:02Z")

</div>

Hey Victor,

It seems there’s a bug with the custom actions feature. My workaround was to send the data to an internal collection inside Adalo and trigger a Zapier workflow that way. Any time a new record was recognized in the collection, an email would be sent.

Hope it helps a little

---

<div class="post-metadata">

**Author:** ![Victor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/victor/32/2054_2.png) [@Victor](https://forum.adalo.com/u/Victor)\
**Post date:** [May 17, 2021, 3:42pm UTC](https://forum.adalo.com/t/custom-action-error/12530/16 "2021-05-17T15:42:50Z")

</div>

To start with - glad you’ve found a workaround.

Reg JSON - as for me it’s difficult to say whether it is a bug or a feature.

By the standard, JSON **does not allow** line breaks inside it; line breaks should be replaced with “\n”.  
So, from one point of view, custom action not working when JSON contains line breaks (which as I see happened in your case) is kind of “expected behaviour”.

For example, this custom action of email sending doesn’t work:

 ![Screenshot 2021-05-17 at 13.15.02](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/c/cfcc076c584f1c3362f9ac70d4e35ac940d063cd.png)

And this custom action works:  
 ![Screenshot 2021-05-17 at 13.15.58](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/a/a091937ba7706d173ffb0d98b3c3ba754809d175.png)

From other perspective, it could be a good idea to replace line breaks with \n automatically. There is no easy way to do that from the app builder, unfortunately.

@theadaloguy have you submitted any ticket reg. this? I didn’t find anything on Canny, you think it is worth a feature request?

Best,  
Victor

---

<div class="post-metadata">

**Author:** ![theadaloguy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/theadaloguy/32/8023_2.png) [@theadaloguy](https://forum.adalo.com/u/theadaloguy)\
**Post date:** [May 17, 2021, 7:06pm UTC](https://forum.adalo.com/t/custom-action-error/12530/17 "2021-05-17T19:06:46Z")

</div>

@Victor I didn’t submit a ticket this has been an issue for a long time particularly when people are trying to do emails e.g. Sendgrid.

I’m thinking to create a solution for it, but a feature request might be good.

---

<div class="post-metadata">

**Author:** ![liba2](https://avatars.discourse-cdn.com/v4/letter/l/b782af/32.png) [@liba2](https://forum.adalo.com/u/liba2)\
**Post date:** [June 1, 2021, 8:36pm UTC](https://forum.adalo.com/t/custom-action-error/12530/18 "2021-06-01T20:36:26Z")

</div>

I was struggling my self for hours to understand why my custom action wasn’t working until I found this post.  
I made an inspection on the flow of data from beginning to the end, and I found 1 space that was adding a new line in the end of string content and nothing more, that was blocking the custom action, probably as @Victor said above:

_By the standard, JSON **does not allow** line breaks inside it; line breaks should be replaced with “\n”._  
_So, from one point of view, custom action not working when JSON contains line breaks (which as I see happened in your case) is kind of “expected behaviour”._

I took it out and everything worked smoothly. In my case a “string function like TRIM” would treat the value and would make it work. But I understand TRIM function will not cover all cases as you can have break-lines in the middle of string content.
