August 4, 200916 yr Newbies Hello all, I am sorry if this is a really straight forward issue. I am having trouble searching for the answer. Hence my little post here. First let me explain our situation: Basically, I have a field in my database that is a list of keywords that we use to categorize each record. Some records have 1 keyword, some have 25, some have none. Its an open field with only one repetition. we separate keywords basically by hitting enter, each keyword gets its own line. We also did it this way so that there would be no limit to the number of keywords each record could have. Now for the problem: I have about 1500 records that need to have a keyword added to them. All of the records have different sets of keywords. I want to globally add a keyword to the bottom of the list of each records (alphabetical ordering doesn't matter, since this field is often just searched), WITHOUT replacing the already existing keywords for each record in that field. Append, not overwrite. I dont want to confuse anyone with extra details. but if i am missing something that might help figure this out. please let me know. I would be more than happy to provide info that will help. Thanks!
August 4, 200916 yr Find the records you want to modify, and do Replace Field Contents… with calculated result = YourField & ¶ & "New Keyword" Make sure you have a backup, as there's no undo if you happen to mess it up.
August 4, 200916 yr Author Newbies Perfect. Exactly what i was looking for. I knew it was going to be "replace field contents...", just didn't know how to tell filemaker to keep what's already there. adding the "enter symbol" was part two. thank you so much. Now that we have this working: if i wanted to create a script to do this, is there a way to have it pop up with a dialog box asking what to add? for example, the keywords field would be constant. I would never do this with any of the other fields in my database. but the keyword being entered would change. can i have a popup that asks what to place in that area. I think i know how to build the rest of the script. thanks in advanced! All your help is greatly appreciated.
August 4, 200916 yr I think it would best to pop up a custom dialog asking for the new keyword (you will need a global text field to take the input). So roughly: # Find the records to update Set Field [ gInput ; "" ] Show Custom Dialog [ gInput ] If [ not IsEmpty ( gInput ) ] Replace Field Contents [ Keywords ; Replace with calculation: Keywords & ¶ & gInput ] End If However, keep in mind that in a multi-user scenario Replace Field Contents[] might encounter records that are locked by other users.
December 31, 200916 yr Author Newbies Hey there, sorry i never replied to say "thanks". Your suggestion worked like a charm. Have been using the script ever since. If you would be so kind i have an additional question in the same vein: I am looking to now globally replace a keyword across a select set of contacts. For example, might have a 100 people marked down with a "client" keyword, but i would like to replace "client" with "preferred client". Is there a way to do the same type of replace field contents but have it search for what to replace? Hence, search for "client". Also, I want to make sure to that if there is a "client meeting" keyword, for example. that the replacement would not cause that to change to "preferred client meeting". It will only change the "client" Each keyword is separated by a ¶ "return" if that helps at all. Thanks for anything you might suggest. Johnathon
December 31, 200916 yr Is there a way to do the same type of replace field contents but have it search for what to replace? Yes, it's possible - but by now there's a red light blinking: replacing field contents is suitable for a one-time re-organization - not for day-to-day operations. I am very troubled to hear that you "have been using the script ever since" 5 months ago. Perhaps if you explained why it's necessary to replace "client" with "preferred client" so often, a better approach could be found to the entire issue.
January 4, 201016 yr Author Newbies Hey there, Thanks for your concern. I was probably exaggerating a bit (or just slightly inaccurate) by saying "using it ever since". I meant more that the script is built into our solution now. Honestly, since August (when i first started this thread), i have used it twice, but now have the option to add a keyword to multiple contacts whenever needed. Which is nice. I dont imagine this to be used more than 1-2 times a year. And it is only done by myself, not by others here at the office. On that note, as far as other users in our shared situation halting the process. That is not an issue either. Like i said, i am the only one that is allowed to make these changes to our database. and when i need to do a massive change like this i do it first thing in the morning before anyone else arrives. Not to mention its a small office. As for my recent post here. We are dealing with a similar situation. I need to change about 200 contacts that have one keyword, replacing with another. Without destroying the other keywords those contacts have. This would be done about 2-4 times a year total. So it would not be used on a day to day basis. No where near it. That being said i would still like to build a script for this as well. So that i can access the script and execute it when needed, and not have to worry about remembering the exact language for the script. Let me know if there is any additional information about my solution that might help. A note about keywords: I would not be shocked if there was a better solution for our "keyword" setup. We originally ported our contact book from "Now-Contact". Which used keywords for sorting contacts in a really great way. However, NC does a lot of things in a very un-smart way, as well. And the development of new software versions has been a very slow moving machine. So we decided to move on... One of the prerequisites when reviewing replacement software was being able to import the keywords and use them afterwards in the solution. The owner here at my company uses them religiously to keep his contacts organized. Anyway, the whole point of mentioning this, is that there might be a better solution for managing these key words. but with the past and current restriction considered, what i have going now works best. These requests are things that the old software did. I am just trying to replicate the Old software as closely as possible within filemaker. It is amazing how much FM can do. Maybe one day i just need to start a thread related to "replicating now contact's keywords in filemaker" but i know that will make for one lengthy discussion. this just seams easier at the moment. Thanks again, Johnathon
January 4, 201016 yr OK, then. So try replacing the field contents with something like = Substitute ( "¶¶" & Keywords & "¶¶" ; [ "¶client¶" ; "¶preferred client¶" ] ; [ "¶¶" ; "" ] )
Create an account or sign in to comment