AFAIK, you cannot declare variables in bases formulas. However, you can always just write the function again inside your formula instead of assigning it to a variable. It looks a bit messy, but it works.
From your code, I’m not completely sure what you want to achieve, because you are not referencing the value of the first .map() in your second .map().
In general, functions cannot be recursive. So if the first .map() relies on the second .map(), which in turn requires the value of the first .map(), this can never work.
You can simulate variables by using another formula. Give formula a the value or formula you want to reuse. In other formulas, you can then type formula.a to reference it.
However, what are value1 and value2? If both of them are values conveyed by noteList, then no variable declaration is necessary.
Or if it’s a situation where you need to manipulate value1 (really just value) to get value2, then what you showed is essentially:
noteList.map(
file(value.map("however you get to value2 from value1")).properties.num
* file(value).properties.num
)
The values are the corresponding value of the map function, the problem is that value1 provides a file with another list of notes, to each of one (accessed by the map2 via value2) I want to multiply another property from value1
I’m not thinking clearly at the moment so apologies for the half effort here, but does it help to consider passing yourself all of the values in lists of lists? In the vein of: