Variable in exportcell( in Text Disply Object

I have a text display object that works fine. However, I have one field that should be displayed that is referenced by a global variable, as this field changes every week. Is there a way to reference this field from a variable.
The global variable is gxCurFld and contains the name of a field. Update is a Field from the datasheet.
+exportcell(gxCurFld) ;<-- this is what I can’t figure out

also, is it possible to put a formula in an exportcell( ?

The fieldvalue( function can be used to reference that field.

fieldvalue("", gxCurFld)

Not exactly, but the formulavalue( can be used to accomplish the same end.


Exportcell( is a convenient way to convert the value of a field whose datatype might not be known to text. If you know the field will be numeric, you could also use the str( or pattern( function to convert it. If you know it will be a date, you could also use datepattern(, and if you know it will be text, no conversion is necessary.

1 Like

That’s close to what I need. Both suggestions fill the Text Display column with the value of a currently selected record from the field defined by gxCurFld. I need something to display the individual values of the field referenced by variable gxCurFld (which holds the current field).

Reading between the lines, it sounds like your text display formula is an arraybuild(. There was nothing to suggest that in your original post. We normally say that the formula in an arraybuild( function must be quoted, but actually any text producing formula whose result is the desired formula will work. You are using a formula to generate a formula, which then generates your result.

arraybuild(cr(), "", "exportcell(«Updated»)+tab()+exportcell(«"+gxCurField+"»)")

The actual formula was generated by Construct: List/Matrix and looks like this: exportcell(«Payee»)+tab()+

exportcell(«Updated») +tab()+
formulavalue(“exportcell(«”+gxCurFld+“»)”) ; this was your suggestion

That last line fills the Text Display column with whatever value is in the record referenced by gxCurFld. What I need is a way to view the items in the column referenced by gxCurFld as if it were a real field.

So I tried something else, which also doesn’t work
Field CurWk
Formulafill (gxCurFld) ; where gxCurFld hold the name of the field to copy. All of my efforts to use a variable to access a particular field has not worked. I’m sure there is a way, it used to work in P6.
I know that Field(gxCurFld) works to move to variable field, but that’s as far as I can get.

This formula works, however, I have upto 70+ field in the database and only need this to work on 2. When I try to use it on one field, as with other suggestions, it fills the receiving field with a single value and not the values from the field.

I am sorry for all the trouble, but I have dozens of databases to convert, which I am kind of enjoying, until I hit something that I can’t convert or make work and end up spending days trying to work around.

I simply want to be able to access all the data in a field and transfer it to another field with one of those field referenced by a variable. Worked in P6, apparently no more. If there is such a way, please, please help me.

If this is not possible and never will be, let me know so I can abandon this database.