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
7 subscribers
Views
2881 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Hi, I have a rule input called ri!state which gets its value from a query r
aswinb
over 11 years ago
Hi,
I have a rule input called ri!state which gets its value from a query rule. Then I am passing this rule input to the value and saveInto fields of a textbox like this:
a!textField(
label:"State",
value:ri!state,
saveInto:ri!state)
I am getting an error called "Cannot save type List of Text into Text". The only way I found to solve this problem is by passing null to saveInto field. Is there a way around to solve this problem and why I am getting this error?
thanks...
OriginalPostID-104466
OriginalPostID-104466
Discussion posts and replies are publicly visible
0
Eduardo Fuentes
Appian Employee
over 11 years ago
Query rules return an array of items; even if there's only result the return type will be a list of items with a single item inside.
If you are expecting a single value use the index() function to retrieve the first value of the query rule's array.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aswinb
over 11 years ago
I tried doing the index function but the error still exists if I try to use the same rule input which receives the value and try to store into it using savInto. Don't know why this is happening but usually everybody saves into the same variable that was used to recieve the value from the qurery rule.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 11 years ago
May I see the syntax of the whole expression when using the index() function?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 11 years ago
Is it related to your finding from
forum.appian.com/.../e-104568
?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aswinb
over 11 years ago
I solved the problem. You see we cannot use a query rule directly to store value into a local variable or a rule input. You have to first use the query rule inside an expression rule and then use that expression rule to populate your rule input or local variable. This solved my problem. Thanks for your concern though.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aswinb
over 11 years ago
sorry yes it is related to my finding from the link that you mentioned.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel