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
7 replies
Subscribers
6 subscribers
Views
2746 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Process
Hello, we are using a web service that returns a nested multiple CDT and are una
Howard
over 11 years ago
Hello, we are using a web service that returns a nested multiple CDT and are unable to extract all the records for the nested multiple CDT. I attempted to follow the steps from a previous post, but was only able to get the first record. Since we are still on 6.6.1, I had to use the DoForEach() instead of apply(). Am I missing something from this procedure? Thanks.
1. I have a CDT called "provisionInfoLAPS"
2. Each "provisionInfoLAPS" has an array of another CDT called "ipAddress"
3. In my model I have a process variable of type multiple provisionInfoLAPS called provisionInfo
4. I want to retrieve the list of "alumni" for each "ipAddress" inside pv!provisionInfo
5. I created a rule called: rule!returnipAddressList which receives an input of type "ANY TYPE" called "provisionInfo" and defined as =ri!provision.IPAddress
7. In my model, in a script task after the web service I have: doforeach("returnIpAddressList",pv!provisionInfo)
...
OriginalPostID-78237
OriginalPostID-78237
Discussion posts and replies are publicly visible
0
Tejas Kargutkar
Appian Employee
over 11 years ago
Hello Howard,
From your description, I think the following documentation may help you save values from a nested array of Web service data.
forum.appian.com/.../Call_Web_Service_Smart_Service
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Jim Beckley
Appian Employee
over 11 years ago
Also, here's some additional documentation, which may be useful to you.
forum.appian.com/.../Mapping_Data_Within_a_Process_Model
These help topics basically say you can cast just the nested multiple element of your variable to a new CDT, which allows you easier access to the data.
If you have the following data structure:
provisionInfoLAPS
- PrimitiveElementOne
- PrimitiveElementTwo
- NestedCDT_ipAddress
You need to create a new CDT (pv!newCDT) that matches just the NestedCDT_ipAddress element. Then you can cast the data using the following expression on a script task.
pv!provisionInfoLAPS.NestedCDT_ipAddress
is stored as
pv!newCDT
Then you can save the alumni list into a simple text multiple using the following operation
pv!newCDT.alumni
is stored as
pv!alumniList_textMultiple
Hope that helps!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Howard
over 11 years ago
Jim, I did create a CDT that I believe matches the nested CDT element, but I receive the error "Cannot slice index (index by name on a list) when the element has no list type (Data Outputs)" when I try to save the value. Does that mean I did not create the exact structure? Thanks.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Howard
over 11 years ago
FYI, I was able to get the data in the nested CDT by explicity defining the index and storing it into a process variable of that data type. pv!provisionInfoLAPS[1].IPAddress
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Chasity Davis
over 11 years ago
howardng - did you end up doing this data mapping of the nested CDT to a pv! in the output of the Call Web Service node or in a Script Task after the Call Web Service node? Thanks!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Howard
over 11 years ago
It was done in a Script Task after the Web Service node.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Chasity Davis
over 11 years ago
thank you!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel