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
9 replies
Subscribers
6 subscribers
Views
3712 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Process
I have a database table that contains group records. The fields are Id, Name, T
helmuta
over 11 years ago
I have a database table that contains group records. The fields are Id, Name, Type, Category, Status, etc. I am trying to retrieve the name for a given Id.
Let me draw an example:
Id Name Type Category Status
1 OMG Cookies Project Food Active
2 Dream Home Project Home Active
I have created a query rule that returns the entire record. The input is the record id. So in the above given record id 1 it would return
1 OMG Cookies Project Food Active but all I really want is the name OMG Cookies.
I have thought of a couple of workarounds to get the name only but I was hoping there is an easy way for me to do this without doing a lot of unnecessary stuff.
Any help would be appreciated. ...
OriginalPostID-96242
OriginalPostID-96242
Discussion posts and replies are publicly visible
0
priyal.patel
Appian Employee
over 11 years ago
All you have to do is specify which field you want with a "." notation!
Example: someQueryRule(id).name - this will give you just the name field!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
revat.anandsongkit
Appian Employee
over 11 years ago
You can use dot notation. For example, if we assume your query rule is called rule!APP_getObjectById(), you can do the following:
rule!APP_getObjectById(1).name which will only return the name field. Hope that helps.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
helmuta
over 11 years ago
Thank you! I knew there had to be an easy way to retrieve this piece of information.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
helmuta
over 11 years ago
One more question. I have a new query rule that returns all of the active records and I need to expose the names in a dropdown and be able to store the associated id in a pv.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
priyal.patel
Appian Employee
over 11 years ago
I have done this by running the full query rule in an activity class parameter on a user input node.
Then on the form, for the dropdown display I choose ac!query.name and for the value choose ac!query.id.
Does that make sense?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
helmuta
over 11 years ago
Will this show a list of names? I will have several names that I will need to expose on the form.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
priyal.patel
Appian Employee
over 11 years ago
Yes, that will show the names and then the actual values that will be saved are the corresponding ids.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
helmuta
over 11 years ago
Great, Thank you so much.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Annelise Dubrovsky
Appian Employee
over 11 years ago
When you only want to use a couple fields in a CDT, consider querying for the data using the queryrecord() function in the Appian Scripting Functions category. It allows you to specify only the fields you need rather than returning the whole CDT structure.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel