Ok, I have found how to do this. If anyone is interested, the right portion of the expression was calculated this way:
Right($feature.R_ROL,(Count($feature.R_ROL) - (Find('-', $feature.R_ROL) +1)))
R_ROL is the field to search for and - is the character used to calculate right and left portion.
When you want a loop function, the closest option is usually one of the Aggregate functions.
Use the array_agg function, which "Returns an array of aggregated values from a field or expression." To get an array of Z values, use:
array_agg( z( $geometry))
You can easily add a new function to get array of z-values from line vertices.
Open Function Editor tab in Field Calculator (or Expression) window. Create a new function by clicking plus icon. Enter a file name, e.g. z_array_from_line.
Copy/Paste the script. Then, click Save and Load Functions (or related button) to register the function. It's added 'Custom'...
If you are having problems with the download you could use python, example:
from shutil import copyfile
from os.path import join, basename
download_folder = '/home/bera/GIS/test/downloads/'
filepath_field = 'filepath'
layer = iface.activeLayer()
for feature in layer.getFeatures():
src = feature[filepath_field]
dst = join(download_folder, basename(...