What's the proper use of index function?

Certified Senior Developer

Hello!

I'm having a doubt about the use of the function index(), as a best practice in Appian development.

In the Appian documentation appears as: indexdata, index, default ), but I know that we can use the function as: indexdata, index, index, index... (as many as needed), default ), to navigate between an object and it returns the value needed.

The question is: Should I use nested index() functions? or Is better to use just one index function with many indexes inside?

Example:

{CountriesES, CountriesUS, CountriesNL} -> Cities -> Town

1 - Index(CountriesES, "Cities", "Town", null)

2 - Index(lIndex(CountriesES, "Cities", null), "Town", null).

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Associate Developer

    According to me index function is used to fetch the value from any particular data at a given index from any data.

    for example:- index(data,index,{}), for example suppose i have querry rule and want to fetch data so i will simply do like this-- index(query rule,"data",{}), and suppose if i need to fetch furhter value from data than in that case we will use nested index function with data as the first parameter and the whichever field we want to extract that will become the second parameter. and the third parameter is important to give because suppose if your expression doesn't find value at the index what you are looking for so it should return something instead of giving errors so to avoid that error we pass the null parameter. I hope that answers your query.

  • 0
    Certified Lead Developer
    in reply to taruns7606

    I just published a blog post about the index() function.

    appian.rocks/.../

Reply Children
No Data