7 Replies Latest reply on Dec 19, 2014 4:39 AM by john@outdoorflooring.ca

    setting a "flag field" for multiple records

    john@outdoorflooring.ca

      Title

      setting a "flag field" for multiple records

      Post

      Hi all. We are using Filemaker for our contacts and mail chimp to send email campaigns. When sending a campaign I export a found set of contacts to mail chimp and work within mail chimp to create the HTML email... That works for us for now.

      I am having trouble flagging the contact records in filemaker to be associated with multiple email campaigns.

      I am currently using one check box field in the contacts table. (see attached pic) The list is referencing a different table of campaign names.

      I am having trouble setting the newly added campaign to that check box field without blowing away the previously checked names.and when I try to go back to a found set of records and add a campaign name to the check box field using replace, it also wipes out the previously checked campaign names. I have tried using a portal system to relate the campaign names and the challenge of setting or associating multiple contact records with the one campaign is still unmanageable. any suggestions?

      Thanks, John

      KPRO_flag.png

        • 1. Re: setting a "flag field" for multiple records
          john@outdoorflooring.ca

          A follow up to this is that will will have hundred of campaigns and a check box filed is restricted to not allowing scrolling in it's display so I would need an infinite page length to view all the campaigns at once.

          • 2. Re: setting a "flag field" for multiple records
            john@outdoorflooring.ca

            Sorry for all the after thoughts. I am going crazy trying to figure this out... for the portal I created a many to many relationship which in theory works well but again adding multiple contacts to the same (current) campaign in one swoop is difficult.

            • 3. Re: setting a "flag field" for multiple records
              philmodjunk

              I see no reason why updating the value list will have any effect on the values stored in the fields of existing records. And I do not see how clicking a check box in this field will "wipes out the previously checked campaign names."  Perhaps you are using either Replace Field Contents or Set Field in a script to add a selected value to a check box field?

              Is this the basic scenario?

              You perform a find for a set of emails and then "flag" them to make them all members of a new email campaign?

              It IS possible to use check boxes for that, but you have to do it in a way that doesn't overwrite existing data in the field.

              Say your field is named YourTable::YourCheckBoxField. the following expression used as the second parameter of a set field step or a replace field contents operation (using the calculation option) will preserve existing data in the field by appending new data to the field:

              If ( IsEmpty ( FilterValues ( YourTable::YourCheckBoxField ; "NewValueHere" ) ) ;
                   List ( YourTable::YourCheckBoxField ; "NewValueHere" ) ;
                   YourTable::YourCheckBoxField )

              The If function ensures that you can't accidentally add the same exact value to the field more than once. (Check box fields store their selected values as a list of values separated by a return so using the List function like this appends a new value to that list without altering existing data.)

              But personally, I'd set up a join table linking a Table of "campaign" records to the table of Email addresses and manage this as the many to many relationship that it is. Using a Join table is a more flexible way to manage many to many relationships. You can use a looping script to loop through your found set and create one new record in the join table for each record as a way to select each record in the found set to "flag" it for the new campaign.

              • 4. Re: setting a "flag field" for multiple records
                john@outdoorflooring.ca

                 Thanks for your prompt reply. and thanks for the above suggestion... I agree the related table is the way to go and as just mentioned I tried a many to many relationship and  (sorry for my lack of expertise) but I am having trouble conceptualizing the process to "add a campaign to the contact record" with one easy button (probably a script I can;t quite figure out yet)

                • 5. Re: setting a "flag field" for multiple records
                  john@outdoorflooring.ca

                  Here is the simple many to many relationship I created.

                  • 6. Re: setting a "flag field" for multiple records
                    philmodjunk

                    Adding a contact to a selected campaign is a matter of creating a new record in Campaigns Link with the needed ID's to link it to the specified campaign record and the current contact record.

                    The easiest way to do that is to set up a portal to Campaigns Link on your T05_Contacts layout. Format ID_Campaign with a "use values from field" value list where field 1 is the values of Con_Email_Campaign::ID and Field 2 is campaign name. This value list allows you to select a campaign by name, but enters the appropriate ID.

                    But there are scripted methods that would also allow you to find multiple contact records select a campaign record once and then the script loops through the contacts creating one new join table record for each.

                    • 7. Re: setting a "flag field" for multiple records
                      john@outdoorflooring.ca

                      Thanks for this answer. I learn something from you each message. I will attempt the script and probably come back to you for help... Thanks PhilModJunk.