Skip to main content
June 10, 2025
Question

Intergration Intermittently Returning Null

  • June 10, 2025
  • 3 replies
  • 0 views

I have an interface that calls 2 different intergrations. There is data that return for both integrations, but it randomly returns null after calling it multiple times. 

I have inserted where I am calling the integrations.

    a!localVariables(
      local!historyData: a!refreshVariable(
        value: index(
          rule!GET_incomingRequestHistoryByID(requestId: ri!requestId).result,
          "body",
          {}
        ),
        refreshOnReferencedVarChange: true()
      ),
      local!requestDetails: a!refreshVariable(
        value: index(
          rule!GET_allIncomingRequestsByID(refundRequestId: ri!requestId).result,
          "body",
          {}
        ),
        refreshOnReferencedVarChange: true()
      ),

This is what my error looks like when 1 integration returns as null

This is what my local variable looks like when both integrations return data: 

    3 replies

    shubhama926776
    June 11, 2025

    The error occurs because the interface directly accesses nested data (like requestDetails.responses) using dot notation, which fails if the integration returns null or an unexpected structure. Instead, use index() with a default value (e.g. index(data, "property", {})) to safely handle null responses. This ensures the grid won’t break when integrations fail. Always validate API responses before rendering to avoid such errors.

    varuntejg243705
    June 11, 2025

    Hi [mention:cb000c01eb194af199ffedba27c1da75:e9ed411860ed4f2ba0265705b8793d05] ,

    Always use indexing by index() function, (.) notation will not handle the null values and moreover check whether you are filtering the correct ri!requestId, pass it manually to verify that the data is correct.

    index(rule!GET_allIncomingRequestsByID(refundRequestId: ri!requestId),"result",{})


    could be the best indexing, and im not sure why the response from the ri!requestDetails are not passing into interface while calling, check whether the refresh variable is also working by using this interface as child interface in a parent.

    davidj137213
    June 11, 2025

    You need to use the index function with the defaultValue parameter to correct this behavior. It's a fairly common mistake. Additionally, you need to account for how the interface behaves when the result is null. I would also recommend contacting the person responsible for the integration to understand why it's intermittently returning null.