Hi Team,
I understood how index function works, but can someone please write a code(with example) using index function with cdt.
Discussion posts and replies are publicly visible
Hello sowmyak2554
Please refer the below documentation
index()
Interface Recipes : Set the value of a CDT field based on a user input
Hi sowmyak2554 ,
Lets assume you have 3 column in a CDT EmployeeData as "Name", "Number", "City". now if you want to fetch all the values of City column, you need to use the index function as below:Index(Your_CDT,column_Name,default_Value)
Index(EmployeeData, "City", null)
And in case of Record type, code syntax will be same. but you can not index it directly by giving the column name, you need to pass the column name as below
Index(EmployeeData, recordType!yourRecordName.fields.yourField, null)
For readability I continue to recommend people use "property()" when attempting to get a dot property, and reserve "index()" for finding the index (position) of an array. The two functions are interchangeable but that doesn't mean readability isn't muddled when one is overused.