Perform Find/Replace
Finds/replaces data according to the options in the Perform Find/Replace Options dialog box.
Options
- With dialog specifies whether to display the Find/Replace Summary dialog box at the end of the find/replace operation. Setting With dialog to Off also prevents display of the confirmation dialog box when a Replace All operation is executed.
If you want the user to be able to enter find or replace criteria, use the Open Find/Replace script step.
- Perform lets you choose which action you want the find/replace to perform:
- Find Next finds an instance of the find term.
- Replace & Find finds an instance of the find term, then replaces the term and searches for the next instance when the script is run again.
- Replace All finds and replaces all instances of the find term.
- Replace replaces highlighted text that matches the find term with the replace term. When using the Replace action, you may need to pair the Perform Find/Replace script step with the Select All script step.
- Find what specifies the find term.
- Replace with specifies text to replace instances of the find term.
- Direction specifies the direction you want the find/replace to search through records.
- Match case considers the find term’s case when performing the find.
- Match whole words only omits finds where the find term is embedded in another word.
- All records/requests finds within all records/requests in the found set.
- Current records/requests restricts the find to the current record/request.
- All fields finds within every field on the layout.
- Current field restricts the find to within the active field. You can use the Go to Field script step to select the field before the Find/Replace is performed.
Compatibility
Product | Supported |
FileMaker Pro | Yes |
FileMaker Go | No |
FileMaker WebDirect | No |
FileMaker Server | No |
FileMaker Cloud | No |
FileMaker Data API | No |
Custom Web Publishing | No |
Originated in version
6.0 or earlier
Description
If Perform Find/Replace doesn't find data that matches the find term, it doesn’t return an error.
Example 1
Replaces text in the Reorder Level field that matches the find criteria in all records without prompting the user.
Copy
Go to Field [Products::Reorder Level]
Perform Find/Replace [With dialog: Off; 1; 3; Replace All]
Example 2
Goes to the next occurrence of the product name in the Description field.
Copy
Show Custom Dialog ["Do you want to find the current product name in the Description field?"]
If [Get ( LastMessageChoice ) = 1]
Go to Field [Products::Description]
Perform Find/Replace [With dialog: Off; Products::Name; Find Next]
End If
Example 3
Replaces specific terms in the current field with record data.
Copy
Show Custom Dialog ["Do you want to replace placeholder terms with record data?"]
If [Get ( LastMessageChoice ) = 1]
Perform Find/Replace [With dialog: Off; "[NAME]"; Customers::Name; Replace All]
Perform Find/Replace [With dialog: Off; "[COMPANY]"; Customers::Company; Replace All]
Perform Find/Replace [With dialog: Off; "[ADDRESS]"; Customers::Address; Replace All]
End If