Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
5 replies
Subscribers
7 subscribers
Views
2605 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
I am having troubles with this bit of code: index( ri!arrayOfCom
mokhtarc970
over 8 years ago
I am having troubles with this bit of code:
index(
ri!arrayOfComponent,
wherecontains(
ri!arrayOfProduct[ri!index].id,
ri!arrayOfComponent.FK_productId
),
{}
),
It generates an error for which I don't really get the reason
a!applyComponents [line 25]: Invalid index: Cannot index property 'FK_productId' of type Text into type List of Variant
this FK_productId is an Integer type in the arrayComponent CDT so I don't understand why it says it is a text.
I've tryed tointeger and tostring casts to solve with no result
thanks
OriginalPostID-207016
OriginalPostID-207016
Discussion posts and replies are publicly visible
Parents
0
shailendras593
over 8 years ago
Hi mokhtarc,
Seems that the ri!arrayOfComponent is having a null value and that's why you unable to access its field. Can you try adding a null check like
if(
rule!APN_isBlank(ri!arrayOfComponent),
null,
index(
ri!arrayOfComponent,
wherecontains(
ri!arrayOfProduct[ri!index].id,
ri!arrayOfComponent.FK_productId
),
{}
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
shailendras593
over 8 years ago
Hi mokhtarc,
Seems that the ri!arrayOfComponent is having a null value and that's why you unable to access its field. Can you try adding a null check like
if(
rule!APN_isBlank(ri!arrayOfComponent),
null,
index(
ri!arrayOfComponent,
wherecontains(
ri!arrayOfProduct[ri!index].id,
ri!arrayOfComponent.FK_productId
),
{}
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data