“Invalid index: Cannot index property ’’identifier’’ of type String into type List of Variant

A Score Level 1

Expression evaluation error [evaluation ID = H0IAIER6]

in rule 'apac_getidentifiersforexcelreport'

(called by rules 'apac_sgp_importrqstlogrptdisplay' > 'apac_sgp_reportsdashboard'): “Invalid index: Cannot index property ’’identifier’’ of type String into type List of Variant

Can someone guide where to proceed with this defect ?

this errro comes in reports 

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Associate Developer

    Can someone help me in fixing this error with the below code. I tried using the property() but is not giving me any results.

    rule!RGRACSLBL_QE_getLabelChangeCountryByFilters(
    requestId: 10365,
    country: "Germany").id_int

  • 0
    Certified Lead Developer
    in reply to pavitra2005

    Much as in the original post here, the error message you're seeing there indicates that the result of your rule call for rule!RGRACSLBL_QE_getLabelChangeCountryByFilters(), with the parameters you listed, is returning an empty set, and you're trying to directly index the property named "id_int" into it.  This would work if the rule (when executed against those parameters) returned a dictionary including a member named "id_int" -- but if you directly check the rule itself, i believe you will find it does not.

    If you want to handle the case of the rule returning nothing, without producing this pink error, then correct use of the property() function should help you.  I don't know what you tried already and found not to work, but the following *will* work assuming other things are configured as normal:

    property(
      rule!RGRACSLBL_QE_getLabelChangeCountryByFilters(
        requestId: 10365,
        country: "Germany"
      ),
      "id_int",
      null()
    )

Reply
  • 0
    Certified Lead Developer
    in reply to pavitra2005

    Much as in the original post here, the error message you're seeing there indicates that the result of your rule call for rule!RGRACSLBL_QE_getLabelChangeCountryByFilters(), with the parameters you listed, is returning an empty set, and you're trying to directly index the property named "id_int" into it.  This would work if the rule (when executed against those parameters) returned a dictionary including a member named "id_int" -- but if you directly check the rule itself, i believe you will find it does not.

    If you want to handle the case of the rule returning nothing, without producing this pink error, then correct use of the property() function should help you.  I don't know what you tried already and found not to work, but the following *will* work assuming other things are configured as normal:

    property(
      rule!RGRACSLBL_QE_getLabelChangeCountryByFilters(
        requestId: 10365,
        country: "Germany"
      ),
      "id_int",
      null()
    )

Children
No Data