Skip to main content
Known Participant
Oct 4, 2023 2:27 PM UTC
Solved

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

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) 

 

Inspiring
Oct 4, 2023 2:40 PM UTC

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

Inspiring
Oct 4, 2023 2:40 PM UTC

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
Oct 4, 2023 3:06 PM UTC

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.

Known Participant
Oct 4, 2023 3:37 PM UTC

it return all the data of the customer 

mikes0011
Brainy
Oct 4, 2023 3:48 PM UTC

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