More fun with line items

Is there a way to find a line item field within the current record by the value that’s in it? For example, if SKU2 = 564, I want to go to the field SKU2 in the current record.

Assuming the line item fields whose names start with SKU end with numbers in sequence (SKU1, SKU2 etc), use a FOR loop to build an array containing the value of each SKU field in the current record starting with SKU1, and then use arraysearch( to find to location of “564” in the array, which will also be the SKU number, unless arraysearch( returns 0.

“SKU” + Arraysearch(lineitemarry(“SKU”,“;”),“564”,1,“;”) should return the line item field that you are looking for, but I have not tested this.

Thank you David and Bruce. Can’t believe I missed lineitemarray( as it has lineitem right there in the name!