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
1746 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Stuck and looking for suggestions... I'm attempting to append a s
thoward
over 10 years ago
Stuck and looking for suggestions...
I'm attempting to append a string of text, received via a web service, into a multi denominational field within a CDT. And then to display that information into a Grid on a SAIL form.
I'm trying to use the code below but does not work. According to the 'apply' function, the second parameter needs to be a list and doesn't work as an array. Does anyone know how to get data from either a delimited string or array into a 'List'?
CDT = Order
Field = Order.item
Field = Order.qty
WSItem = "Pen, Pincle"
WSqyt = "5,10"
apply(rule!writeToCDT, split(WSitem, ",") <== didn't work
apply(rule!writeToCDT, WSitem ) <== also didn't work
------
rule!writeToCDT:
append(pv!Order.item, passedInItem)...
OriginalPostID-106584
OriginalPostID-106584
Discussion posts and replies are publicly visible
0
jesse.triplett
Appian Employee
over 10 years ago
I'm not sure you need the apply at all, since append can take a multiple input itself.
Is this supposed to be in the SAIL form? I ask because you have pv!Order.item written in that rule.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
thoward
over 10 years ago
Not sure I understand. Are you saying there is a better was to populate a dimensional CDT field with the data other than an apply() function? If so, could you point me in that direction. I'm always in favor of doing things the easy way when possible. This is my first time working with CDT and I'm still learning.
Thanks,
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Ricardo Galvan
Appian Employee
over 10 years ago
You can simplify the process and do the apply and merge functions to have two items that are in a list appended to a string. The following code is an example on how you can achieve this:
=apply(rule!ruleToGenerateList,merge(ri!firstComponent,ri!secondComponent),", ")
The “, “ at the end of the code will make it coma separated.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
thoward
over 10 years ago
Thanks Recardo, I'll dig into the merge function. My only concern is that the number of 'components' I can receive via the service is unpredictable. Can the merge function take, and array? The Help file seem to imply it can, but I just get errors when I try.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Ricardo Galvan
Appian Employee
over 10 years ago
As the documentation states, the merge function can take a number of lists (a list being an any-type array) and merge it into a single list. If you do not know the number of components, you can have only one ri! which is the list of the components that will be needed to merge and apply the function using that list.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel