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
3 replies
Subscribers
7 subscribers
Views
3873 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Hi, I’m looking for a solution to dynamically convert a dictionary to a lis
borisb
A Score Level 1
over 8 years ago
Hi,
I’m looking for a solution to dynamically convert a dictionary to a list of dictionary with the items in the dictionary.
So for instance I have the following dictionary:
{employerId:9, advisorNumber:"AAA", id:33}
And I want to create a list with all the items in that dictionary. So basically the result should be the following:
{{employerId:9}, {advisorNumber:"AAA"},{id:33}}
This should be done dynamically since the items in the dictionary are not fixed.
Does anyone know a good solution or already build something simulair?
Thanks in advance!
OriginalPostID-188910
OriginalPostID-188910
Discussion posts and replies are publicly visible
0
Tom Ryan
Appian Employee
over 8 years ago
Not sure if this is possible to do dynamically in SAIL, but if not, should be easy with a custom function plugin.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
marky
over 8 years ago
The apply function returns an array, so you can use the following where rule!returnSelf is a rule that returns the rule input (any type):
{
fn!apply
(
rule!returnSelf,
ri!data.employerId
),
fn!apply
(
rule!returnSelf,
ri!data.advisorNumber
),
fn!apply
(
rule!returnSelf,
ri!data.id
)
}
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
borisb
A Score Level 1
over 8 years ago
Thanks guys.
Eventually I got this working by converting the data dictionary to xml with the toxml function. Then I used a combination of xpath functions to get the field names and values.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel