Skip to main content
October 4, 2023
Solved

Customer can only be indexed into using square brackets or the index function) (Data Outputs)

  • October 4, 2023
  • 5 replies
  • 0 views

What is the right way to index a specific field? 

im getting index error (Customer can only be indexed into using square brackets or the index function) 

 

Best answer by dineshd0003

Hi I hope you already got the dataset from that expression rule!skjGetCustomerByAcc().

To refer the particular column value use something like rule!skjGetCustomerByAcc().data.column1, but its always better to go with index 

index(
index(rule!skjGetCustomerByAcc(),"data",null),
"column1",
null)

5 replies

October 4, 2023

Hi I hope you already got the dataset from that expression rule!skjGetCustomerByAcc().

To refer the particular column value use something like rule!skjGetCustomerByAcc().data.column1, but its always better to go with index 

index(
index(rule!skjGetCustomerByAcc(),"data",null),
"column1",
null)

stefanhelzle0001
Brainy
October 4, 2023

We do not know what that expression returns. Can you share that with us? Or at least, show us how the returned data looks like.

October 4, 2023

it return all the data of the customer 

mikes0011
Brainy
October 4, 2023

Why are you using ".data" when calling the expression rule in the parent, when the expression rule itself already returns the ".data" element of the query?

The Expression Guru