3 Replies Latest reply on Jun 17, 2011 1:56 PM by philmodjunk

    Combine data from two buttons into a new third button?

    JonathanFreund

      Title

      Combine data from two buttons into a new third button?

      Post

      For a Value List of Radio buttons, I need to combine or convert the data from two existing buttons/values into a new button/value. The original two buttons/values would then be deleted and future entries will use the new button/value. Like so:

      Current List of Values, as radio buttons:

      Metro
      West
      Valley
      South
      Other

      Metro and West values are to be comined into a new value "City" so the new list would be:

      City
      Valley
      South
      Other

      I am sure the is a solution I have not yet found, perhaps because of the terminology I have been using. Any help is appreciated.

       

        • 1. Re: Combine data from two buttons into a new third button?
          philmodjunk

          Is this a specific one time change you need to make or an example of a technique the database users will need to have in order to manage their data?

          You really have two tasks here: 1) update the value list to display the new list of values and 2) update the existing data so that all records marked Metro and West are now marked as City.

          Updating the value list can require editing a custom value list, or if you store these values in a table where they then supply the value list with values, it can simply be a case of editing the records in this table. This could be scripted if this is a task that may need to be done repeatedly.

          Updating the values in the existing records requires performing a find to find all records with the two values then using Replace Field Contents to update them to store the new value. This also could be scripted.

          Let me know if you want examples of how to do this with a script where you specify the two values to be merged and then merge them.

          • 2. Re: Combine data from two buttons into a new third button?
            JonathanFreund

            Thanks, Phil.

            This is a one time change to all existing records.  Current records with Metro or West will be changed to City. Metro and West will then be permanently deleted as values, and future entries will use City instead (unless they fall under the another value).

            If I understand you, this is what I need to do:

            1. Add new value "City" to the current list
            2. Find all records with Metro OR West.
            3. Perform Replace Field Contents so all records with Metro or West now show City.
            4. Delete values Metro and West
            5. Edit Layout

            Is that right? I have never done a Replace Field Contents, and while I am fairly savvy I would appreciate an example if one is readily available.

            • 3. Re: Combine data from two buttons into a new third button?
              philmodjunk

              You've got it, though there may be no need to edit the layout as the change to the value list and the replace field contents operation should handle all the changes. I suppose you could reduce the size of the field since you'll have one less radio button showing...

              1. Make a back up copy of your file just in case you make a mistake.
              2. Enter find mode and select Metro
              3. Select new Request from the requests menu
              4. select West.
              5. Perform Find.
              6. Edit value list to add City and remove West and Metro.
              7. Click on the radio button to select City
              8. Leaving the focus in the radio button field (Don't press tab, don't click the layout background), select Replace Field Contents from the Records menu.
              9. You'll be asked if you want to put "City" in this field for all records in your found set.
              10. Click Ok and you are done.