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
7 replies
Subscribers
7 subscribers
Views
2687 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
While deleting a row from a normal grid, how do I get the index of the deleted r
padmanabhanv
over 11 years ago
While deleting a row from a normal grid, how do I get the index of the deleted row?...
OriginalPostID-93494
OriginalPostID-93494
Discussion posts and replies are publicly visible
0
Sathya Srinivasan
Appian Employee
over 11 years ago
you need to use JS.
Instead, can you not simply do a difference() on the original and updated PV on the data-->output to identify the changed row?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
padmanabhanv
over 11 years ago
Sathya, I am facing an issue while deleting a row. I am displaying the grid using values from a CDT(multiple), however the values of the grid are stored into multiple form variables. After a row is deleted how do I update the parent CDT. I tried getting the index and using the remove function; not working.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sathya Srinivasan
Appian Employee
over 11 years ago
I just saw you mention normal grid.
try this:- add a hidden numeric column to your grid and populate the data via this code
enumerate(yourCDT.size)
Save the value into an ACP (say rowIndexer)
on the DATA-> output, do difference(enumerate(cdt.length), acp!rowIndexer)
This will give you the index of the row that was deleted. You can use remove() function to remove this from the CDT array either in the same place or in a different script task.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
padmanabhanv
over 11 years ago
Thanks sathya; that did it
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
chandhinir
over 11 years ago
Hi Sathya,
I have to get the deleted row index of a grid.
When I tried using the above method, it worked.
Say for example,
my CDT length is 4 then enumerate(4) would be 0,1,2,3-->row index acp value
If I delete 1st and 3rd row,then my grid length would be 2
enumerate(2)-->0,1
In this scenario,I am getting the incorrect index.
Please provide your suggestions.
Thanks!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sathya Srinivasan
Appian Employee
over 11 years ago
If you've deleted the 2 rows (i.e. row1 &3), your data is no longer 4 but 2. So next time you take an action, you are interested in just the remaining 2, right? You may want to check your delete logic.
On the other hand, if you're looking for just a running sequence where each number represents a row in a fixed fashion, then again, the same logic would work where-by you enumerate only once on the size of the array and persist (or map) the value against the rows. When you delete row 1 & 3, this array will be made of row 2 and 4 which will be mapped to the corresponding two elements in the grid. Both the approaches should work on the same basis.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
chandhinir
over 11 years ago
Thanks for your reply.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel