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
4 replies
Subscribers
7 subscribers
Views
2582 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Today's logic problem: I'm looking to dynamically generate an ncolumnta
Chris
over 8 years ago
Today's logic problem: I'm looking to dynamically generate an ncolumntable() for use in HTML documentation. For example, we collect task history in SQL and like to attach this in HTML emails and audit documents - each process may utilize a different set of history information, so I would like to build this table dynamically based on column header and field inputs, but can't seem to get the code working correctly. The idea is something like this:
load(
local!columns: {"Task","Owner"},
local!fields: {"task","owner"},
local!data: {{task: "Approval",owner: "Jim"},{task: "Submit",owner: "Steve"},{task: "Review",owner: "Joe"}},
ncolumntable(
local!columns,
apply(rule!test_getData(data: local!data, field: _),
local!fields
)
)
)
Where rule!test_getData() is defined simply as (data - Any Type, field - text):
index(ri!data,ri!field,null)
Since ncolumntable() is expecting a different array for each column, the...
OriginalPostID-195148
OriginalPostID-195148
Discussion posts and replies are publicly visible
Parents
0
Matthew Kornfield
Appian Employee
over 8 years ago
Yep that should also work! You can probably use touniformstring() as well instead of applying the tostring function.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
Matthew Kornfield
Appian Employee
over 8 years ago
Yep that should also work! You can probably use touniformstring() as well instead of applying the tostring function.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data