Custom Code Block

Hi All,

I feel i am missing something very obvious and simple but with the custom code block all i want to do is set a property in app data, i cannot use the return function as it has to be done via a event listener and thus i cant pass the function back into UI Builder by conventional means.

So basically returning a polgon i have created in the custom code to be set as a property in appData

I would assume something similar to this, however appData doesnt seem directly available.

___arguments.context.appData[‘geofencePolygons’] = ({ [Color]: undefined,[Polygon]: undefined });

Your assistance as always is appreciated.

Kind Regards,
Raymond

Hello @Raymond_Woodley

We will be happy to assist you.
Sorry, but I didn’t quite understand your question.
I need to ask you a few more questions so I can understand the problem better.

Please provide your app ID.
If your question is about the logic you implemented in Builder, please provide the name of the container and the page.
What result do you want to get?
What steps have you already taken for this?

Regards,
Volodymyr

App ID:FB172318-89F2-E225-FF10-9AC9657A9000

Function: Geo - Google Map Polyline and Marker Adder

I Am adding Polyines, Polygons and markers to a google map component, I am "geofencing new polygons directly on the google map components and am just trying to return the data to save in the database.

Thank You.

It’s hard to say where directly the problem is located for a reason it should be precisely debugged and investigated, but as far as it is a business logic unrelated to Backendless we can’t do it.

But, some not-obvious things I could see:

if (!arguments.context.appData) {
   arguments.context.appData = {};
}

Basically, arguments is a system array containing all the called function’s arguments, but here you try to achieve a context property of the array. Is it intended?

Returning to the start of the conversation. You could easily set the App Data property, for this just pass the App Data block to the Custom Code block as arguments.

Hi Dima Thank you for your response it actually gave me exactly what i needed.

Thank you.

Kind Regards,
Raymond