Skip to main content
Inspiring
Aug 12, 2022 7:32 AM UTC
Question

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

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
Aug 12, 2022 8:35 AM UTC

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

Inspiring
Aug 12, 2022 8:38 AM UTC

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

stefanhelzle0001
Brainy
Aug 12, 2022 8:39 AM UTC

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

Inspiring
Aug 12, 2022 10:42 AM UTC

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

mikes0011
Brainy
Aug 12, 2022 2:13 PM UTC

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
Inspiring
Aug 18, 2022 8:56 AM UTC

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