Is it that you want your employees to enter all the items in a single field with / or some other character as the delimitter and then the script trigger generates the line item records? Wonder if a button to the right of such a field to tap might give your users a bit better control over the process.
Set Variable [$ItemList ; Substitute ( WorkOuts::input ; "/" ; ¶ ) ]
Set Variable [$WorkoutID ; WorkOuts::ID ]
Exit Loop if [$K > valueCount ( $ItemList ) ]
Set Variable [$K ; Value: $K + 1 ]
Set Field [ LineItems::ID ; $ID]
Set Field [ LineItems::Item ; GetValue ( $ItemList ; $K ) ]
Go to layout [Original layout]
Set Field [WorkOuts::Input ; "" ] //clear the field so the user can add new items if necessary.
Thanks I will give this a go. I was trying to avoid a button, I'm running out of real-estate on the ipad.
The reason I'm thinking button is when I put myself in the shoes of your employees, I can see how a trigger makes it easy to inadvertently perform this script when I may not have fully entered the last item.