Index() or dot notation?

Certified Lead Developer

Hi All,

I just wanted to know what's Appian best practices when it comes to retrieving data from a data subset. Should I index into the data subset or use dot notation? I noticed that when I use index() it doesn't throw an error for a null result set but does throws an error if I use dot notation. I know dot notation would cause a pink screen error on the tempo interface but debugging this would be quite simple since we know exactly where the error is coming from. For index(), this wont throw an error on tempo but will be harder to debug and would be a silent fail if a user doesn't raise the issue that that data is coming null when it shouldn't. 

  Discussion posts and replies are publicly visible

Parents
  • If your CDT is the correct type it does not matter whether you use index() or dot notation. index() is more dangerous since it can hide upstream type mismatch errors. If you think you may benefit from having a dependency graph of CDT field references you can also write custom index rules per field. This is useful when you need to refactor your application or just evaluating the feasibility of new requirements, so that you can see all the dependents of a particular field.
Reply
  • If your CDT is the correct type it does not matter whether you use index() or dot notation. index() is more dangerous since it can hide upstream type mismatch errors. If you think you may benefit from having a dependency graph of CDT field references you can also write custom index rules per field. This is useful when you need to refactor your application or just evaluating the feasibility of new requirements, so that you can see all the dependents of a particular field.
Children
No Data