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
8 replies
Subscribers
5 subscribers
Views
2337 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Integrations
I'm trying to integrate with a service that has nested multiples. I have fo
Chasity Davis
over 10 years ago
I'm trying to integrate with a service that has nested multiples. I have followed all directions I can find on forum, but I'm still stuck. I created a PV of the parent CDT of the nested multiple, but I'm still unsure as to how to retrieve the elements that are supposed to be returned for that nested multiple. I can also see in the application log file that the elements are getting returned in the web service response....but how do I map them to a PV or my pre-existing CDT? Also, I continue to get this error...(Cannot slice index (index by name on a list) when the element has no list type) (Data Outputs)
Please help!
...
OriginalPostID-103475
OriginalPostID-103475
Discussion posts and replies are publicly visible
0
Jim Beckley
Appian Employee
over 10 years ago
Let's say you have a CDT that represents a phone tree for school administrators with a nested multiple of six elementary schools. Rather than trying to handle the whole phone tree, an easier approach would be to create a new CDT that matches just the branches and leaves of the tree for a single school -- and use that new CDT as the type of your target PV (make sure it's a multiple value PV). You could then map your data at the root of the school node (the principal) instead of trying to replicate the entire hierarchy. The matching leaves and branches of the school hierarchy would then be cast to the matching hierarchy in your new PV. Therefore, instead of mapping ac!district to pv!district you'd map something like ac!district.principal to pv!school.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Jim Beckley
Appian Employee
over 10 years ago
Also, if district were a multiple, you'll need to map something like ac!district[1].principal to pv!school -- with the bracketed number indicating which district you want to save.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 10 years ago
Can you attach a screenshot explaining what you see vs what you are trying to store so I can explain in terms of the names of your own CDTs?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 10 years ago
I should have refreshed the post before posting my previous comment; Jim's explanation should be definitely a good reference
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Chasity Davis
over 10 years ago
Thanks for the comments guys! I did create a CDT last night that matches just the nested multiple in the web service. I saved the parent of the nested web service to it's own PV (of type defined by the web service, and a multiple). In a script task after the "Call Web Service" node I created an output that maps the following:
pv!holding.securityPosition
is stored as
securityPosition (the CDT I created that matches the nested multiple and is a multiple)
I get this error in my script task..."There is a problem with task “Script Task” in the process “TESTING_Get Holdings Web Service Call”. ERROR:An error occurred while evaluating expression: securityPosition:pv!holding.securityPosition (Cannot slice index (index by name on a list) when the element has no list type) (Data Outputs)"
Am I getting this error because I'm not defining the index? i.e. [1] The problem is I was all values returned, not just for a specific index.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 10 years ago
1. Is pv!holding marked as "Multiple"? The error suggests it's not a multiple.
2. If it's a multiple and you keep getting that error try this instead:
---> 2.1 Create a rule and call it, let's say: getSecurityPosition with a single input of type "Any Type" (Single)
---> 2.2 Define it as follows:
=ri!holding.securityPosition
---> 2.3 In your script task instead of using pv!holding.securityPosition
=apply(rule!getSecurityPosition,pv!holding)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Chasity Davis
over 10 years ago
Yes, holding is a multiple. I was able to get something to work yesterday, but I'm not a fan of the solution as I'm sure there is a more effecient way to handle it. After the "Call Web Service", I find the length of pv!holding, and then for each index in pv!holding I append pv!holding[index#].securityPosition to pv!securityPosition. I'm doing this in a script task, next an XOR that determines if there are more indexes, another script task that adds one to the index and then back into the script task that appends pv!holding[index#].securityPosition to pv!securityPosition. So my solution works, but I'm sure it's not the most efficient. I'll try your solution. Thanks!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Chasity Davis
over 10 years ago
That worked wonderfully! Thank you Eduardo!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel