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
2 replies
Subscribers
7 subscribers
Views
1042 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
I have a xml like <root> <record>Tom,20,male</record>
shaoyongw
over 10 years ago
I have a xml like
<root>
<record>Tom,20,male</record>
<record>Lucy,30,female</record>
...
</root>
How to convert it into a cdt array person(name,age,gender)[] in an expression rule? ...
OriginalPostID-120054
OriginalPostID-120054
Discussion posts and replies are publicly visible
Parents
0
Sathya Srinivasan
Appian Employee
over 10 years ago
toRecord() might not help you in this instance because your XML is not well defined to map directly into the Person CDT.
What you need to do is create a RULE that takes each element (that is <record>) from this XML and tokenizes the string to get the three of the values as an array.
Then you need to use the type!person() function to build each element of your CDT
So you would do something like
type!person(name:ri!myparsedArray[0], age:ri!myparsedArray[1] ...)
Then you call this rule within an apply function and you iterate through each of the <record> element
Let me know if this is clear.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
Sathya Srinivasan
Appian Employee
over 10 years ago
toRecord() might not help you in this instance because your XML is not well defined to map directly into the Person CDT.
What you need to do is create a RULE that takes each element (that is <record>) from this XML and tokenizes the string to get the three of the values as an array.
Then you need to use the type!person() function to build each element of your CDT
So you would do something like
type!person(name:ri!myparsedArray[0], age:ri!myparsedArray[1] ...)
Then you call this rule within an apply function and you iterate through each of the <record> element
Let me know if this is clear.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data