Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Suggested Answer
+1
person also asked this
people also asked this
Replies
3 replies
Answers
1 answer
Subscribers
8 subscribers
Views
3437 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
I have 2 fields(LastName and FirstName), I want to return it as one field(name)
narasimham357
over 9 years ago
I have 2 fields(LastName and FirstName), I want to return it as one field(name) concatenated in a!Query ,I did following using a!queryColumn , it is not working any suggestions appreciated
a!querySelection(columns: {
a!queryColumn(field: "LastName"&" "&"FirstName", alias="Name" ),
OriginalPostID-174672
OriginalPostID-174672
Discussion posts and replies are publicly visible
0
Shyam Bommakanti
Certified Lead Developer
over 9 years ago
You can only concatenate the output of the query not the columns in the query itself.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
@narasimham It isn't possible using the a!queryColumn but definitely it is doable and one of the several possible ways of doing it is, you could create a database view (which contains all the columns from the source table and an additional column that concats the first name and last name columns) and then create a cdt + data store entity that maps to the database view.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
+1
prestonb
over 9 years ago
Once you run your query, you have a data subset. You can then use merge and apply to process the data subset one name at a time.
We do something similar in this code, concatenating two fields together with a dash.
with(
local!query: a!query(pagingInfo: topaginginfo(1, -1)),
local!ds: a!queryEntity(entity: cons!RC_REQUEST, query: local!query),
local!merge: merge(local!ds.data.tRequestAction, local!ds.data.tRequestCategory),
apply(fn!concat(_, "-", _), local!merge)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Reject Answer
Cancel