Codeless only part working.. but works fully if using backendless to invoke

If i run the codeless code from my Backendless API Servies > invoke,

  • I get serial based upon email+secret generated…
  • I get PAID = true and SERIAL = [generated_serial]…
  • I also get an email upon the input email address. the email with the serial in it.

However if i testrun the webhook it only generates a serial and marks PAID as true.
IT DOESN’T UPDATE THE SERIAL IN DATABASE. AND DOESN’T SEND THE EMAIL.

I have literally no idea why this is happening, feels like a cached version gets run and not the up to date version.

APPLICATION ID = FF55A111-06AF-7EB1-FFDE-B5B62760CA00

Hi Jessie,

Try adding some logging along the logic in the API service and check the logs. To add the logging, you can use the print block. The log messages can be seen in the Real Time Logging window or in the log files available in the /logging directory of the File storage in your app.

Regards,
Mark

I have been checking RT logs already… it doesn’t say anyfin outta the ordinary…

the only bug i can see is that it only generates a serial and then marks PAID as true in database.
IT DOESN’T UPDATE THE SERIAL IN DATABASE.and the email part dont work??

but all works when testing?

EDIT: attaching image

Try adding a try/catch block around the whole thing and log any errors it catches

i added that just now.. but no different .. i think there might be something wrong with my account’s logging of errors and info in both files and RT logging no changes when expected

Hi @JesterOC

You missed await before the following execution:

      Backendless.Messaging.sendEmail(subject, bodyParts, [cleanEmail]);

as a result, the server worker ends before sending the API request to the server

regards,
Vlad

tried that just now but i’m getting a strange error popup when adding “await” . i have included a pic.
image

Try copy/pasting the code to ChatGPT and ask it about the “Missing ;” before statement error. See what it will advise you

I figured out it’s cus I needed an async function (without chatGPT).. so put the code in and am about to test it.

1 Like

How can i get the results of the await Backendless.Messaging.sendEmail(subject, bodyParts, [cleanEmail]); call into a variable fer logging?? the email doesn’t work with invoke now, whereas before invoke sent the email.

this appears to me to be a backendless bug…
how else can invoke be different codewise/functionality-wise?

var result = await Backendless.Messaging.sendEmail(subject, bodyParts, [cleanEmail]);

You can also check the log file to see if there are any errors.

I decided to use codeless email block but it’s also only working via invoke… as i mentioned before i think my account’s logging is broken… it rarely even shows the logs i have setup.
So no help from logs.

here’s my current setup

what it’s doing:

  • works flawlessly via invoke

  • doesn’t work in testing it fully… only saves PAID as true, doesn’t send email.

EDIT: I HAVE JUST FINISHED DECIPHERING AN ERROR EMAIL FROM THE CURRENT SETUP. ITS ERRORING CUS OF A “NESTED GROUP” EXCEPTION… THOUGH I HAVE NO IDEA WHY. ALL IT SAYS IS “EXCEPTION: NESTED GROUP”