Expression error

Certified Lead Developer

 Expression evaluation error at function a!isNullOrEmpty parameter 1 ???null???: Invalid index: Cannot index property 'x' of type Text into type List of Variant.

 

This error is faced by user when opening record action. This is only faced by a specific user. when I open the same request, I am not getting this error. Also in design error log only highlights the process which calls the interface. This error looks very high level and not highlighting the object name clearly. Does anyone faced any similar kind of issue? Please let me know if there is way to debug this.

  Discussion posts and replies are publicly visible

  • 0
    Certified Senior Developer

    Hi  ,

    I hope you are indexing using the following expression: a!isNullOrEmpty(ri!data.x).

    But at runtime:

    • ri!data NOT a map/CDT, It is a List of Variant (array)

    So Appian can’t do .x(Index) on a list

    Correction  : Always use Index() Function.

    a!isNullOrEmpty(index(ri!data, "x", null))


    Note : Never use dot notation (.x) unless you are 100% sure it's a single object.

    If you cannot find the object that poses this error, you can search it in the objects tab and put search type as expression, and check in the dependent objects only.

    Quick summary : The error happens because your code assumes a single object but receives a list for that specific user, causing .x access to fail. Fix it by using safe access like index() instead of dot notation, since data structure can vary per user.

  • 0
    Certified Lead Developer

    Generally it happens when, The specific user has corrupt or unexpected data in their record.
    Open Process Monitor -> find that user's process instance -> inspect the variable values directly.
    Replace unsafe dot notation like pv.myData.x with index(pv.myData, "x", null) before a!isNullOrEmpty() in the record action interface/process.

    Try this things and let us know if that works for you.

  • 0
    Certified Lead Developer

    As its user specific, it seems to be a data error. To debug the cause of the error, I suggest the below

    1. Focus on the property 'x'. Log into the related UI configured in the record action and replace any loggedInUser() with the username of user facing the issue temporarily in interface. Pass in the parameters as is expected to be passed from record action process to the interface. You should see the same error as the user. 

    2. Debug the UI by checking all the places 'x' is used. And user property(local!variant,"x",{}) wherever its referenced until you are able to find the exact cause/resolve the error.

    Let me know how this goes