4 Replies Latest reply on Jul 14, 2013 5:10 PM by afterhours

    Remove Formatting from Fields

    BradWieland

      Title

      Remove Formatting from Fields

      Post

            

           I want to add this calculated expression to many fields to permanently strip out custom formatting:

      TextFormatRemove ( self )

           The problem is, I already have the expression below as a calculation in many of the fields:

           If ( IsEmpty ( text access sku01 ) ; "" ; "$" & If ( text access sku01 ≥ 1000 ; Int ( text access sku01 / 1000 ) & "," ; "" ) & Right ( Int ( text access sku01 ) ; 3 ) & Left ( text access sku01 - Int ( text access sku01 ) + .001 ; 3 ) ) & " US"

           Can I have both expressions for a single field? How do I do that?

        • 1. Re: Remove Formatting from Fields
          davidanders

               This is the Help File for the question

          http://help.filemaker.com/app/answers/detail/a_id/5674/~/removing-text-formatting-from-a-field-in-filemaker-pro

          Removing Text Formatting From a Field in FileMaker Pro
               How do I remove text formatting from a field?
          Answer ID: 5674Last Updated: Dec 03, 2011

          • 2. Re: Remove Formatting from Fields
            BradWieland

                 Thanks for the response, David. I know how to remove the text formatting. I just don't know how to combine the two expressions in my post together. Probably a simple operator; I just don't know how that should be formatted.

            • 3. Re: Remove Formatting from Fields
              philmodjunk

                   Nest your if function inside the textformatremove function:

                   TextFormatRemove ( If ( IsEmpty ( text access sku01 ) ; "" ; "$" & If ( text access sku01 ≥ 1000 ; Int ( text access sku01 / 1000 ) & "," ; "" ) & Right ( Int ( text access sku01 ) ; 3 ) & Left ( text access sku01 - Int ( text access sku01 ) + .001 ; 3 ) ) & " US" )

              • 4. Re: Remove Formatting from Fields
                afterhours

                     I've often wondered if there was a way to step through each field in a particular existing record to 'update' the format (remove any format that came in via cut/paste from another source).   I've played around with some scripts, isolating the record of interest with the old

                     show all records

                     omit record

                     show omitted

                     trick to show only the one record.  I've written a few scripts to try and attempt a more elegant method than brute forcing each field of interest using the Replace Field Contents tool have failed.   Ideally, I'd love to craft a way to start at the first field (in Tab order) of a layout,

                     set a page variable for that field's name using Set Variable [$FieldToFormat, Value Get (ActiveFieldName)]

                     then remove the formatting for that field, and loop through the next tab order field and repeat.   Ultimately work my way through an entire data entry form to resolve all formatting snafus.   Thus far, I've been stuck since using even simple tools like:

                     Set Field By Name [$FieldToFormat, TextFormatRemove (GetField ($FieldToFormat,))]

                     doesn't work as I expected.   Formats remain.  Bummer.

                     Any ideas of what I'm overlooking?

                     Filemaker Pro Advanced 11, OS 10.7.5