Arraybuild(, ««field»» and fieldvalue(

I use arraybuild( and arrayselectedbuild( a lot, but there is a strange error here.

According to the help pages for arraybuild( and aggregate(, the ««field»» notation ‘specifies that a field is in the current database, instead of the database that is being scanned/aggregated’. Also a post by Jim in 2019 confirms my interpretation of that sentence:

Therefore if I take this tree of names:

Tree

and from it make a database of each Person and his Parent:

then the Children of each Person would be an array of all the Persons in this database whose Parent is this Person. With a comma and space separating the Children, the formula for them should be:

arraybuild( {, }, {}, {Person}, {Parent=««Person»»} )

However, that results in the error:

fieldvalue( function: data field “Person” does not exist.

The help page for arraybuild( also states:

Internally, Panorama actually converts double chevrons into the fieldvalue( function.

and if I do that conversion myself, modifying the above formula to:

arraybuild( {, }, {}, {Person}, {Parent=fieldvalue("",Person)} )

then I get the result I originally wanted:

So why does this work using fieldvalue( but not the simpler ««...»» notation? Perhaps ««…»» doesn’t take account of the possibility that the database in question might be the current one, denoted by the empty string.

(I noticed this in a much bigger database containing more complex heirarchical relationships, but this shows the same error more clearly.)

I was able to duplicate this problem using the Formula Workshop. However, it turns out that this is a bug in Formula Workshop, not arraybuild(. If I run this formula in a procedure in the database, it works.

Interesting. It‘s true I haven’t tried it in a procedure, but the same happens for me both in the Formula Workshop and using Morph > Fill with Formula…

That makes sense. The problem is actually in the formulavalue( function, which is used by both the Formula Workshop and the Morph > Fill dialog. I’ll look into fixing this, but for now, just use this in a procedure. It will also work in a graphics object (Text Display, etc.).

Thank you!