Adding A Group of People to a Significant Event

Welcome back to CCBTutorials.com for this week’s tutorial.  

A few weeks back, I stumbled across a request about adding a group of people to a significant event via Church Community Builder’s (CCB) The Village.

I waited a few days to see if a response would surface, but nothing ever surfaced.  Here’s the person’s original request:

We have set up our system so a person’s baptism date is a Significant Event with Date. Normally entering them is fine since we usually only do a handful of baptisms at a time so it goes quickly. 

However, a couple of weeks ago we had a “Baptism Service” and we had around 100 people get baptized in one evening. I thought as the Master Admin I’d be able to do a mass add, but it doesn’t look like the Significant Event field is an option for a mass change. 

Does anyone have any ideas about how to do this without doing them one at a time?   

So, you guessed right if you guessed that today’s tutorial is about adding significant events for individuals.

Let’s get started…

As usual, I won’t go into great detail with this tutorial. 

Fortunately, there are more than enough CCB tutorials that go into detail about how to make the CCB API call and parse the XML response.

To break down the opening statement and question, compile the significant event data for individuals using an Excel/CSV file (see example below).

Add Significant Event to Individual Excel/CSV Files

Once data is compiled, then you’re ready to parse your Excel and CSV File using PHP.

Open a text editor of your choice, naming and saving the file as parse-ase.php.  The ‘ase’ part of file is short for add significant event. 

For more explanation of the parsing Excel and CSV files using PHP, click here.

Notice within the code that there are two functions executed: getPersonId and addPersonSignificantEvent.  Before I explain both functions, don’t forget to include the functions in the general.php file.

The getPersonId function originates from the How to Search for Inactive Individuals or Profiles tutorial.

In short, you provide the function the first name, last name, email and/or phone number, and the function returns the person’s individual CCB id.

Then, take the person’s id, event id, event date and significantEventName, and create another array to be passed to the addPersonSignificantEvent function.

The addPersonSignificantEvent function does the heavy lifting  to add the respective significant event to the person’s profile.

Once the significant event has been successfully created, then the addPersonSignificantEvent function returns a string stating such (see web browser display below).

Add Significant Event to Individual Web Browser Display

Let me close saying that this tutorial could use a bit more error and validation pertaining to the functions.

I simply wanted to provide you with the main scaffolding, and allow you to fill in the rest where you see fit (maybe using other CCB Tutorials).

That’s it for this tutorial.  Save your file, test away in a web browser, and do let me know if you have questions or comments.

Hopefully, you can now kiss those days of manually adding significant events to individuals by hand good bye, and say hello to harnessing the power of CCB’s API automation.

From hours to minutes, I wish you much success.  Now go and find more tasks to do with your newly found time savings. 😉

See you back here next week for another tutorial.

 


Please comment if this tutorial has helped you.