2 Replies Latest reply on Mar 9, 2012 7:02 AM by RonCates

    Get just the field name

    RonCates

      Title

      Get just the field name

      Post

      I'm using GetFieldName () to enter a field name into another auto enter field. It returns Table::fieldname. I would like to just capture the fieldname alone withought the table name. How would I do this?

        • 1. Re: Get just the field name

          You can try:

          If(PatternCount(FieldName;"::")=0;FieldName;Right(FieldName;Length(FieldName)-Position(FieldName;":";Length(FieldName);-1)))

          If you'd want to know the name of the currently active field you can use Get ( ActiveFieldName ) that just returns the name

          regards, Menno

          • 2. Re: Get just the field name
            RonCates

            I ended up creating a little custom function

            FieldNameOnly ( fieldname )

            Let ([
            field = Substitute ( field ; "::" ; "¶"  );
            tablename = GetValue ( field ; 1 )
            fieldname = GetValue ( field ; 2 )

            ];

            fieldname

            )

            Since my goal is to make sure this remains valid even if I change the field name I call it using GetFieldName ().

            FieldNameOnly ( GetFieldName ( Name ) )