Help with a codeless event handler


I’m trying to set up an event handler and have read through the documentation and support forum topics, but I have not been able to find how to make it work.

I have an action in my front end app that changes a boolean field in a database table from false to true. When that happens, I would like to use an event handler to send an event to mixpanel.

This is the codeless logic I have used, what am I doing wrong?

Hello @Luc_Zentar,

As I can see, the condition of triggering the postEvent API is both

wizardComplete = false AND wizardComplete = true

maybe there should be an OR operator instead of AND?
I’ve just checked and AfterUpdate handler worked fine for me.


Hi Olha,

Thank you for your help

What I am trying to achieve is to trigger an action when the wizardComplete changes from false to true. So in the request (before change) it is false, and response (after change) it is true.

I don’t know how to test this in Backendless, but have tested by checking the Mixpanel environment and the event is not being sent when the wizardComplete field is changed.

Ah I see, sorry my fault. Let me check once more.

I’ve checked this issue again.

Firstly, make sure the wizardComplete property exists in the Request and Response, because the body of those objects are

for Request:

	"item": { ... },
	"context": {...}

for Response:

	"result": {...},
	"error": {...}

so the wizardComplete property may be present in item/result, not in the Request/Response directly.

Secondly, please make sure your condition with true/false is valid and the wizardComplete values from Request and Response are not the same.

As for me, the After Update handler works perfectly, so please check the condition of triggering the API inside.

Is there any documentation that helps explain this in more detail for non coders? Or somewhere that I can see the body of the objects and other data from the event listener?

I’m sorry but I don’t understand from your response how to fix this using the codeless logic blocks

You can find the database event handlers description in this documentation.
Full information about Codeless Event Handlers can be found here.

I’ve read all of that documentation, but I can’t see anything there to explain how to use the codeless blocks to access data from the request and response bodies

The documentation says to use the get property of object blocks for the user example:

Which is what I’ve done, but this hasn’t worked for me:

I can suggest you to use the Debug mode for this (my example is for the Person table):

  1. add some logs to your Event Handler, e.g:
  2. redeploy the model
  3. open the real time logging
  4. call the action in your front end app that changes a boolean field in a database table from false to true
  5. you’ll see the printed Response object in logs:

As you can see, the Response object contains the error = null and result = Person object fields. According to the Response structure, the Person’s name can be retrieved this way:

Hope this would be helpful.

Thank you, the real time logging is what I needed to troubleshoot and understand more about the objects.

I have two more questions:

  1. The change to the field in the database is triggered by a webhook back from an external API service, which has been coded in JS. This isn’t triggering the event handler even though the database is updating. I have tested with a button in UI Builder that updates the same field in the database and this does trigger the event handler. Is there something I can do to make sure the event handler triggers from the external webhook?

  2. Both the request and response property show the field to have been true

I thought the request would show the property before the update, is this not correct? Do I need to run a before update event handler first?

Is there any more help possible with this?

I’ve watched some more videos, re-read the documentation and tried a few tests but still can’t work out if the two problems above are expected behaviour (and I need to do something different) or should not be happening.

Thank you

From what I understand: there is an external call into your JS API service in Backendless. Your API service updates an object in the database. When this happens, a real-time listener for the table where you updated an object is not triggered. Is that correct?

Yes that is correct

I just tried and could not reproduce it. Here’s my setup:


API Service (it is codeless, but in reality, it is the same JS). The service retrieves an object, updates a property and saves the object back:
Codeless - BL - ConsoleDemo - Backendless 2022-03-17 17-03-47

For an RT listener, I created a basic page in UI Builder, again, it is the same JS code with our JS SDK:

RT Subscription. When the updated object arrives, I render it through databinding:
UI Builder - ConsoleDemo - Backendless 2022-03-17 17-07-13

Here’s a live demo:

  1. Open the page that has an RT listener first:

  2. In a separate browser, open this page to invoke the API service (you can reload the page to make additional invocations):

Every time the API service is invoked, the “timestamp” property in the first page will change:

I understand you’re running into a problem. In order for us to help you, please provide a minimal reproducible sample.


Hi Mark,

Would it help if you could see this using the app? I have created a test account and can set it ready for you to take the action that changes the database field and does not invoke the event listener.

Hi Luc,

Our support policy is that we do not debug customer apps. If there is any extraneous logic, it will be required to understand it when we look for the problem. As a result, we ask for a minimum reproducible example. It can be as trivial as what I have put together for you.


Ok I understand that, I’ll try to find a way to reproduce the issue and keep working on testing problems as well.

The other issue I have is that when the event handler is triggered, the request and response both come back with the changed value for the database field.

From what I understand in the documentation, the request block should give the value before the object is updated, and the response block should give the value after it is updated:

I am changing a field from false to true, but both request and response comes back with the changed value of true:

This is the logic used to trigger the change:


It isn’t clear to me how to get the value from the database field before the change and the value after the change and be able to use both to trigger logic.

Thank you

Hi Luc,

Could you please describe the entire flow one more time? I thought I understood it and you confirmed, however, now I see you’re using an event handler (After Update) and that actually changes a few things. If you could put together a diagram of the information flow, it would help me understand the scenario better.


Hi Mark,

Sorry yes my fault, it’s an event handler not a listener.

Step 1 - The user is redirected to DocuSign to sign a document, this is presented in the app but they are sent to DocuSign to complete this process.

Step 2 - When the document is signed, the following JS code saves the document in the files section in a new folder for that user based on their objectId, and updates 2x fields in the SignUp database table (step7Complete & wizardComplete)

NB - I think this is the problem with the event handler not being invoked, and I am working to change this code to an API call to see if that fixes this issue

Step 3 - The user is redirected to the same page that they left from, but because the database fields have been updated, they see a different section through onBeforeMount logic

Step 4- At this point, I had hoped that my event handler would record that a change had been made to the database and would perform a number of actions.

Step 5 - Because the above flow does not invoke the event handler, I have created a button that will invoke the handler. This works and prints to real time logging.

But something is wrong with the logic on the afterEvent handler because the request and response item both show the field in the database to be true - but before the change it was false. This means I can’t use the if/then logic above to trigger my actions.

From reading the documentation, I thought the request section would show the state of the database field before the change.

Thanks again Mark, much appreciated!

Hi Luc,

Please see my questions below:

  1. In Step 2, where does the code run? Is it in an API service that is called by DocuSign? Is it on the DocuSign side?
  2. In Step 4, is the event handler “After Update” you showed earlier? If so, where is the actual Update API called from? I didn’t see anything in the previous steps that anything would be updated - the code you showed is for bulkUpdate which doesn’t trigger the After Update handler.