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
3 replies
Subscribers
7 subscribers
Views
2093 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
I have an "Add Items" form that gives the user the option to append in
russl
over 11 years ago
I have an "Add Items" form that gives the user the option to append information about items they would like to order to an items CDT array. I would like to add a cancel button functionality to the form that allows the user to cancel the "Add Items" form without appending any of the information from the form to the items CDT array. I would however like to append the array if the user selects a save items button.
I have tried to configure a way using the if function to only append the CDT if the save items button is selected, however it always appends something in the items array.
Is there a way to only save information in an array from a form if a certain button option is selected and if a different button is selected it will NOT append that item to the array. Thanks. ...
OriginalPostID-92277
OriginalPostID-92277
Discussion posts and replies are publicly visible
0
Christine
Appian Employee
over 11 years ago
You will need to handle this in a gateway. In the gateway, determine if they clicked Save. If they selected save then write to the datastore to save the new values (that can be re-queried as needed). If they selected cancel, then just end this part of the process without writing to the datastore.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Terri McCormick
Appian Employee
over 11 years ago
You can save the button value into an ac!selectedButton (Text), for example either "submit" or "cancel". Then use an if statement in the output expression to determine whether to store the appended array, or the original array:
if(ac!selectedButton="cancel", pv!myArray,append(pv!myArray,ac!myNewValues)) is stored as pv!myArray.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
russl
over 11 years ago
sorry for the late response but these were very helpful, I went with Terri's suggestion because the write to datastore occured later in the process and her expression was best suited for that. Thanks!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel