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
6 replies
Subscribers
10 subscribers
Views
2572 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Data and Records
I have a record that contains a grid field. Within this grid I have two columns
helmuta
over 10 years ago
I have a record that contains a grid field. Within this grid I have two columns that contain information that I want to format. The first field is a user field that currently displays the userid. I would like to format that into a field that contains first name last name. I have a function that does the look up for me but I don't know how to apply it to the field. Here is the layout:
a!gridTextColumn(
label: "Owner",
field:"owner",
data: index(local!data,"owner",{}),
alignment: "CENTER"
),
function that I want to use is COMMON_formatUserFirstLastName that takes an input of type user.
The second column contains a deciaml value that I want to display as a formatted dollar amount. Here is the definition:
a!gridTextColumn(
label: "Price",
field: "dollars",
data: index(loca...
OriginalPostID-139815
OriginalPostID-139815
Discussion posts and replies are publicly visible
0
helmuta
over 10 years ago
...l!data, "dollars", {}),
alignment: "CENTER"
).
Everything I have tried gives a function type error. Any help would be greatly appreciated.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
jackm829
A Score Level 3
over 10 years ago
Try this:
a!gridTextColumn(
label: "Owner",
field:"owner",
data: apply(rule!COMMON_formatUserFirstLastName, index(local!data,"owner",{})),
alignment: "CENTER"
),
a!gridTextColumn(
label: "Price",
field: "dollars",
data: apply(fn!dollar, index(local!data, "dollars", {})),
alignment: "CENTER"
)
Note that the approach here is to "apply" the rules to the owner list and the dollars list. Make sure that local!data.owner is a list of user and that local!data.dollars is a list of decimals or integers.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
helmuta
over 10 years ago
The last item (price) I was able to use the dollar function without any problems. So, I am 50% complete.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
helmuta
over 10 years ago
Thank you JackM829. The apply function on the user field worked like a charm.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
jackm829
A Score Level 3
over 10 years ago
dollar() is multiple safe, meaning that you can pass in a list and dollar({a,b}) = {dollar(a), dollar(b)}. The rule COMMON_formatUserFirstLastName is probably not defined in a way that is compatible with multiples. So best bet is to "apply" this rule as in the code above.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
jackm829
A Score Level 3
over 10 years ago
Okay. Wonderful to hear.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel