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
Discussion posts and replies are publicly visible
Could it be that you defined the rule input to be of type Text? Did you try to select the type Any?
Rule input i selected is of anytype .. still it didnt got resolved ..same error
OK. Then, I need more details. Code snippets, screen shots, anything that helps me to understand what is going on.
a!localVariables( local!IssueStatus: index( ri!issueTransitions, "body", "transitions", "name", {} ), local!IssueIDs: index( ri!issueTransitions, "body", "transitions", "id", {} ), displayvalue( ri!appianIssueStatus, local!IssueStatus, local!IssueIDs, {} ) )
Where ri!IssueTransitions is of type Anytype in expression rule .. But in process model i am fetching the data from integration.. so made this as type HTTPresponse... so i am calling the above code as expression in one of script task
issueTransitions:pv!issueTransitions.result,
appianIssueStatus:ri!status
appianIssueStatus is just of text type
.. but it doesn't give me desired outpu
Hm ... I just checked, the HttpResponse data type does not have a field "result".
BTW, using the index() function with multiple indexes is not officially supported and has weird edge cases. I recommend to not do this.
it is giving the same error actually in the output of Script task. removed index function used dot operator
What is giving which error?
Did you try to change your code from
rule!OIT_getTransactionDetails( issueTransitions:pv!issueTransitions.result, appianIssueStatus:ri!status ) to rule!OIT_getTransactionDetails( issueTransitions:pv!issueTransitions, appianIssueStatus:ri!status )
When you execute this code in a script task, where is ri!status coming from?
I suggest to go back to the beginning, do one step at a time and test&validate each step.
Error means which is mentioned in the Subject..
I tried initially the same as u are suggesting in the chain.. but not a problem I will try to inspect more
from where you are getting httpsRespone? it will help us to put more lights in your help.
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.