Skip to main content
dinesha5713
October 29, 2024
Question

Index Function vs Square Bracket

  • October 29, 2024
  • 12 replies
  • 0 views

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  

12 replies

karumurua531442
October 29, 2024

hi [mention:30bb505c1ca4449ca754b36b7a8ed1d7:e9ed411860ed4f2ba0265705b8793d05]  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.

dinesha5713
October 29, 2024

how do i test that or know and what is the different between copy of the data and  reference to the original data

karumurua531442
October 29, 2024

hi [mention:30bb505c1ca4449ca754b36b7a8ed1d7:e9ed411860ed4f2ba0265705b8793d05]  try taking some text field component and have one saveinto with square bracket logic and another with index. you might see the difference

venkatrea696188
October 29, 2024

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 

. it is crucial for using more complex data structures in saveInto where index() might not work.

This is the drawback of index function

dinesha5713
November 14, 2024


Its access denied