Skip to main content
August 12, 2022
Question

Invalid index: Cannot index property 'result' of type Text into type HttpResponse

  • August 12, 2022
  • 11 replies
  • 1 view

I am using trying to pass httpResponse.result in one of the expression rule .. in script task 

rule!OIT_getTransactionDetails(

httpResponse:ri!httpResponse.result,

activeStatus:ri!status

)

But it returns Error like Invalid index: Cannot index property 'result' of type Text into type HttpResponse.

I know its casting issue , tried with index function also but it returns null then .. not the  values which  i want to retrieve

11 replies

stefanhelzle0001
Brainy
August 12, 2022

Could it be that you defined the rule input to be of type Text? Did you try to select the type Any?

August 12, 2022

Rule input i selected is of anytype .. still it didnt got resolved ..same error

stefanhelzle0001
Brainy
August 12, 2022

OK. Then, I need more details. Code snippets, screen shots, anything that helps me to understand what is going on.

August 12, 2022

from where you are getting httpsRespone? it will help us to put more lights in your help.

mikes0011
Brainy
August 12, 2022

If this is the code going into your script task, you would not write "ri!httpResponse" in the first place.  If your httpResponse has been stored in a PV by a previous node, then you'd write "pv!httpResponse" here.  If your httpResponse is coming in via some other method you haven't specified, then we need more information before being able to suggest much.  But the "ri!" prefix is only for use inside a rule or expression, and will not be valid if called directly from a process model expression editor box in any context.

The Expression Guru
August 18, 2022

Actually i got the Solution  ,Problem was with Data .. Thanks Guys for support