You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -688,6 +688,29 @@ do list(path: "<sourceField>", "var": "<variableName>")
688
688
end
689
689
```
690
690
691
+
#### `do list_as`
692
+
693
+
Iterates over each _named_ element of an array (like [`do list`](#do-list) with a variable name). If multiple arrays are given, iterates over the _corresponding_ elements from each array (i.e., all elements with the same array index, skipping elements whose arrays have already been exhausted).
694
+
695
+
```perl
696
+
do list_as(element_1: "<sourceField_1>"[, ...])
697
+
...
698
+
end
699
+
```
700
+
701
+
E.g.:
702
+
703
+
```perl
704
+
# "ccm:university":["https://ror.org/0304hq317"]
705
+
# "ccm:university_DISPLAYNAME":["Gottfried Wilhelm Leibniz Universität Hannover"]
706
+
set_array("sourceOrga[]")
707
+
do list_as(orgId: "ccm:university[]", orgName: "ccm:university_DISPLAYNAME[]")
708
+
copy_field(orgId, "sourceOrga[].$append.id")
709
+
copy_field(orgName, "sourceOrga[].$last.name")
710
+
end
711
+
# {"sourceOrga":[{"id":"https://ror.org/0304hq317","name":"Gottfried Wilhelm Leibniz Universität Hannover"}]}
712
+
```
713
+
691
714
#### `do once`
692
715
693
716
Executes the statements only once (when the bind is first encountered), not repeatedly for each record.
0 commit comments