In Appian we can use a records fields by square bracket notation or index or dot notation.
what to use where ,what is the best practices , i heard indexing is the best.in some places its not working ,i don't have clear understating
Discussion posts and replies are publicly visible
hi Dinesh Arumugam There is one important difference. index() returns a copy of the data. square-bracket-notation returns a reference to the original data. it is crucial for using more complex data structures in saveInto where index() might not work.
how do i test that or know and what is the different between copy of the data and reference to the original data
https://community.appian.com/discussions/f/general/35388/index-function-or-index-by-the-dot-in-a-variable-example-local-user-name This thread might help ,
plus point of index function is it help's in handling null values
Abhishek Karumuru said:. it is crucial for using more complex data structures in saveInto where index() might not work.
This is the drawback of index function
hi Dinesh Arumugam try taking some text field component and have one saveinto with square bracket logic and another with index. you might see the difference
Its access denied
if we use index(in target) in saveInto the null value only be saved in ri right
The issue with index() is, that it returns a copy of the data, but not a reference. Square brackets return a reference you can use as a saveInto target.
which means index duplicating the actual values and storing them in a new memory location(local) right?ex : local!a : index(ri!detail,1,null)
Correct
and Square brackets is a pointer or link to the original data right ?to understand this i coded :
the 6th line : its pointing to original data .
but when i try to change the local!b, the original data not getting changed ,
if this is wrong code plz show me a code to understand the difference between copy of the data,reference