Hi, i am trying to get details to update, expression rule is working fine but Script Task gives an error like this - Expression evaluation error: “Invalid index: Cannot index property ’’data’’ of type String into type List of Variant) (Data Outputs)

Hi, i am trying to get details to update, expression rule is working fine but Script Task gives an error - Expression evaluation error: “Invalid index: Cannot index property ’’data’’ of type String into type List of Variant) (Data Outputs)

  Discussion posts and replies are publicly visible

Parents
  • Is it possible that you are indexing ".data" in multiple places? For example, one place I've seen this if you create an expression rule that runs a query like this:

    a!queryEntity(
      entity: cons!MY_CONS,
      query: a!query(...)
    ).data

    If you run this expression, it is now returning a list of variant (because that's what the data parameter returns when using a!queryEntity().

    However, if you then call your rule like this in the process modeler: rule!My_Query().data, then you are likely to see the error you pasted above. This is because you already indexed into the data parameter in your expression rule, so you can't index into it again here.

    If you still can't figure it out, I'd suggest pasting your expression for both the rule and the script task so we can help you troubleshoot.

Reply
  • Is it possible that you are indexing ".data" in multiple places? For example, one place I've seen this if you create an expression rule that runs a query like this:

    a!queryEntity(
      entity: cons!MY_CONS,
      query: a!query(...)
    ).data

    If you run this expression, it is now returning a list of variant (because that's what the data parameter returns when using a!queryEntity().

    However, if you then call your rule like this in the process modeler: rule!My_Query().data, then you are likely to see the error you pasted above. This is because you already indexed into the data parameter in your expression rule, so you can't index into it again here.

    If you still can't figure it out, I'd suggest pasting your expression for both the rule and the script task so we can help you troubleshoot.

Children
No Data