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
8 replies
Subscribers
7 subscribers
Views
1754 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
I have a SAIL challenge, a form, in which I'm pulling live data from another
Richard
over 9 years ago
I have a SAIL challenge, a form, in which I'm pulling live data from another web application (via httpQuery). When I use the results to populate two textfields via "value", it will not save those values into a variable. I particular the field labelled "Project Name" exhibits the problem, the next field "Project Manager Name" is what I'm left doing to satisfy being able to save. (Setting refreshAfter to: "KEYPRESS" was an attempt to tickle it to evaluate saveInto....
WontSaveDef.txt
OriginalPostID-154615
OriginalPostID-154615
Discussion posts and replies are publicly visible
0
sikhivahans
over 9 years ago
@richard.nolan If I understand your question correctly, assigning a value using 'value' attribute of a component doesn't save the value to the variable configured using 'saveInto' attribute of the corresponding component. The only way of doing it is by making use of 'saveInto' attribute. If you wish to save the value of the variable configured for a read-only component or an editable component which you may or may not interact with, make sure that the value is saved into the variable under the 'saveInto' of other component(s) which you will definitely interact with.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Richard
over 9 years ago
Yes, I understand the relationship between 'value' and 'saveInto'. I think that I might have a variable scope problem, but I can't be sure. What's happening is that I use an if condition to evaluate whether one variable is null, then display it, or the result of a previously executed httpQuery. No matter what is displayed, the subsequent saveInto fails to save any value at all.
Does that make more sense? The code should be pretty clear too!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Tim
Certified Lead Developer
over 9 years ago
Be aware that the saveInto attribute will only fire if the field has been interacted with by a user, the value does not automatically populate into it.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Richard
over 9 years ago
Thanks Tim, that may be it. Any recommendations on how to get that data if the user doesn't interact with it?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
@richard.nolan Understood, so far I have gone through your code, I didn't find issues related to scope of variable. To reiterate, the values of the read-only components or the components which you may not interact with, should be saved under a component which you definitely make a interaction with.
Further it is also stated in the documentation that 'A user can only update a variable by interacting with a component that has the variable in the component's saveInto parameter.' (Reference: 'Enabling User Interaction' section at https://forum.appian.com/suite/help/7.9/SAIL_Design.html).
Copying the pieces of code which saves value into local!tir_project.project_manager_name and local!tir_project.project_name into 'saveInto' area of 'Next' button of Step 2: Project Details resolves the issue.
For instance, in order to save the value into local!tir_project.project_name irrespective of the interaction, you can do as follows:
a!buttonWidget(
label: "Next",
style: "PRIMARY",
value: 3,
saveInto: {
\ tlocal!currentStep,
\ ta!save(local!tir_project.project_name,if(rule!APN_isBlank(local!tir_project.project_name),index(local!resultSet.data,"projectname",null ),local!tir_project.project_name))
\ t},
validate: true
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Tim
Certified Lead Developer
over 9 years ago
I would recommend forcing it using a!save() in a button as suggested above by @sikhivahans or alternatively you could repeat the logic on the data output tab of the node in process.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Richard
over 9 years ago
D'oh, that makes so much sense, Now that i see it! I'm really just learning SAIL now (this past weekend mostly). Cheers! Thanks very much.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Richard
over 9 years ago
Thanks Tim, I think I've got it now!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel