Backendless Method can't seem to read a data from Close JSON

Hi, we have an issue where one of the data is returning undefined even though it has value inside.


The variables that I’m referring to is ReactivationDateFromCustomActivity.
ReactivationDateFromCustomActivity is getting the value of “custom.cf_KK0yhZAccTAdoQXbrWWtKey7XKlKk2MXYa2HCXGe1eB” which is clearly inside the JSON Data.

If we run it manually (to test it) using the same JSON Data, it works just fine.

This is the sample JSON Data which we are using:

{
  "event": {
    "id": "ev_1nRmKrtRho5pmrjLoTRjAb",
    "data": {
      "id": "acti_cC2ZfoAeFTmmnnp2bzeoRr6oUNhw6cuvNouFzscMT4l",
      "_type": "CustomActivity",
      "users": [],
      "status": "published",
      "lead_id": "lead_3ho9Imgb0x1yGlcnxs2r1mpGnmObPWQtoHYSsDXSrm9",
      "user_id": "user_iOW8xG894oQcPrUirguMy3PRBGvgv32FVxw0CVimfAI",
      "user_name": "Brilliant Grades CENTRAL CS",
      "contact_id": null,
      "created_by": "user_iOW8xG894oQcPrUirguMy3PRBGvgv32FVxw0CVimfAI",
      "updated_by": "user_iOW8xG894oQcPrUirguMy3PRBGvgv32FVxw0CVimfAI",
      "activity_at": "2023-05-08T13:10:10.306000+00:00",
      "date_created": "2023-05-08T13:10:10.306000+00:00",
      "date_updated": "2023-05-08T13:10:23.504000+00:00",
      "created_by_name": "Brilliant Grades CENTRAL CS",
      "organization_id": "orga_7lUFr4azrjwtX3Ls2aZM14Yt8n369T25XNNlk6J9Y6C",
      "updated_by_name": "Brilliant Grades CENTRAL CS",
      "custom_activity_type_id": "actitype_0N9lc3uF1kyh50WGqUSY2F",
      "custom.cf_2IHL568modsWQIw32DiDAbWq0PAQCBeYrdAex6mINHi": "Claudia",
      "custom.cf_58vvLX176dNEgGLxygbSt9xotBVieCxJYsLVgzayjCG": "Placement",
      "custom.cf_6dNj6n13ejUU1P6osEF8OUlS0wn8ZeJhj1GdDliiG7a": 1,
      "custom.cf_KK0yhZAccTAdoQXbrWWtKey7XKlKk2MXYa2HCXGe1eB": "2023-05-14",
      "custom.cf_hsZlQb5wYGKEbslDXiCGZEwOQWjliIqjD9U19r4tZXN": "Existing",
      "custom.cf_jOYRAaHfTxaDOqZLYstmxtZzqR9mD0RUwFdkhVZm6x3": "Yes",
      "custom.cf_k3Pt5pFZFIY4HrwwD8HvX0PxbADufCjYDdiK6Xb7ejo": "0/None"
    },
    "meta": {
      "request_path": "/api/v1/activity/custom/acti_cC2ZfoAeFTmmnnp2bzeoRr6oUNhw6cuvNouFzscMT4l/",
      "request_method": "PUT"
    },
    "action": "updated",
    "lead_id": "lead_3ho9Imgb0x1yGlcnxs2r1mpGnmObPWQtoHYSsDXSrm9",
    "user_id": "user_iOW8xG894oQcPrUirguMy3PRBGvgv32FVxw0CVimfAI",
    "object_id": "acti_cC2ZfoAeFTmmnnp2bzeoRr6oUNhw6cuvNouFzscMT4l",
    "api_key_id": null,
    "request_id": "req_0NXCCiB3qqB6TQQX07czWV",
    "object_type": "activity.custom_activity",
    "date_created": "2023-05-08T13:10:20.376000",
    "date_updated": "2023-05-08T13:10:23.506000",
    "previous_data": {
      "status": "draft",
      "date_updated": "2023-05-08T13:10:17.007000+00:00",
      "custom.cf_58vvLX176dNEgGLxygbSt9xotBVieCxJYsLVgzayjCG": null,
      "custom.cf_hsZlQb5wYGKEbslDXiCGZEwOQWjliIqjD9U19r4tZXN": null,
      "custom.cf_k3Pt5pFZFIY4HrwwD8HvX0PxbADufCjYDdiK6Xb7ejo": null
    },
    "changed_fields": [
      "custom.cf_58vvLX176dNEgGLxygbSt9xotBVieCxJYsLVgzayjCG",
      "custom.cf_hsZlQb5wYGKEbslDXiCGZEwOQWjliIqjD9U19r4tZXN",
      "custom.cf_k3Pt5pFZFIY4HrwwD8HvX0PxbADufCjYDdiK6Xb7ejo",
      "date_updated",
      "status"
    ],
    "organization_id": "orga_7lUFr4azrjwtX3Ls2aZM14Yt8n369T25XNNlk6J9Y6C"
  },
  "subscription_id": "whsub_1X0ku3hAw2XgAygzDk85Ph"
}

Thank you!

Hello @Jomar_Balanag

It’s hard for me to understand what’s going on in your logic beyond the blocks you sent. Is it a timer or a method?
In any case, right now I can only recommend you add logging for each step to track at what point the problem starts and data gets lost.

Regards,
Inna

This is a method called Future_Onboarding_Main.


This is the blocks that we have before the block with errors. There’s no block that will change the data inside of EventData variable.

When we manually test it using the same JSON object, it runs perfectly without losing some data.

@Inna_Shkolnaya

But did you try to perform the logging of each step, as @Inna_Shkolnaya suggested. So you have to check the state at each step of the variable you are interested in until the method completes.
Because it sounds quite strange, that the value isn’t being set in the object (as I understood).