For Refactor Fields, the @FIELDS_MAPPING
array variable is used to describe the attribute table for each input layer. It is an array of "maps", like you typed out, but you would need to use the expression functions to construct it as brackets are not understood as syntax for arrays and maps in the QGIS expression editor (despite the fact that they are displayed like this in the documentation and preview). Here is an example of how you could populate @FIELDS_MAPPING
with "Calculate by Expression":
array(
map(
'name', 'Value',
'type', 10,
'length', 5,
'precision', 0,
'expression', 'Value'
),
map(
'name', 'New_Field',
'type', 10,
'length', 2,
'precision', 0,
'expression', '10'
)
)
This is assuming you are adding an entirely new set of fields, or replacing an attribute table entirely, for each of the input layers.