834
834 Shovel Expressions are used for enrollment processing workflow. 834 is the X12 standard for enrollment records.
Add dummy segment to loop 2000 at position 20150
Note
The outer atFieldRead is necessary because the atFieldModify returns the entire runtime context, but mapping operation using this will assign the result to the incomingrecord_IncomingEnrollment document rather than replace the runtime context.
atFieldRead(<builtin:document/incomingrecord_IncomingEnrollment>,atFieldModify(<builtin:x12root|x12:loop/2000>, insertIntoLoop(getContext(), upsertJsonKey(upsertJsonKey(upsertJsonKey(upsertJsonKey(upsertJsonKey(emptyJsonObject, \"name\", \"ABC\"),\"position\",20150),\"type\",\"Segment\"), \"ABC01\",upsertJsonKey(emptyJsonObject, \"value\",\"123\")),\"ABC02\",upsertJsonKey(emptyJsonObject, \"value\",\"456\")) )) )
Set REF02 in loop 2000 where REF01 = 0F with first 3 characters truncated
atFieldModify(<builtin:document/primary|x12:root|builtin:array|builtin:key/2000|builtin:array>, let ref01 = readField(<builtin:key/REF01/value>) in let ref02 = readField(<builtin:key/REF02/value>) in atFieldModify(<builtin:key/REF02/value>, if (eqString(ref01, "0F"), rightString(ref02, 6), ref02)))