Planning and Building Salesforce Integration: From Concept to Delivery 9 24 15, 12 31

great just let us know when you’re recording or we’re all right hi everybody and welcome this is going to be planning and building Salesforce integrations in case it wasn’t clear from the context this is going to be Salesforce integrations with Drupal 7 specifically before anybody gets shocked that we’re not doing this with WordPress or some bizarre Ruby thing first of all hello my name is Campbell vertice it’s very nice to meet you you might know me from you might know me from the Drupal community as oh the huge manatee or from Twitter as Cambell fort SE or i don’t know if you know me from anywhere else hi and you probably owe me a beer I’ve been a drupal list for about 10 years now a little over ten years my specialty is with as working with large nonprofits which means I get to do a lot of CRM integrations I’ve definitely done a few sales force integrations in my time and also a few less savory CRMs I should tell you that if you have any options Salesforce’s much easier to work with as far as the integrations go then most of the other alternatives out there so this is a subject I like to have a lot of fun with i will talk for a full three or four or five hours on this subject if people let me so that means please do ask me questions during the presentation just type them on it to chat Christina will artino will interrupt me and let me know there’s something important for me to talk about and we can we can discuss what’s going on then all right I think that’s it so we can start here with what I’m not going to talk about which is first of all basics of Salesforce you should know coming into this what is Salesforce what are various Salesforce additions what do they do for me how do you set up sales force in a very basic sense for your organization likewise I’m not going to be covering the basics of droop you should know what is Drupal and the fundamentals about how Drupal likes to store data don’t worry we’re not going to get terribly technical here but I’m going to skip over what is a node and similar questions so with that out of the way what we will cover is going to be much more interesting the big question is how do you connect Drupal with Salesforce what are the tools that are available both in the sales for side and the Drupal site what are their strengths and limitations what’s easy to do and what’s really hard how do you make a plan and actually really important to how do you make a plan how do you document it so that other human beings can understand what the hell your plan was in the first place how do you estimate and then I hope we have some time for me to actually show you guys a basic Salesforce integration and for us to do a little blue sky of what’s possible what are some of the more exciting things that you can do with a properly integrated Salesforce and Drupal system so this slide is just for your notes you should copy down quick because I’m going to move on how to connect so Salesforce makes a few endpoint technologies available for them for you basically you have to authenticate so you whatever requests you make are going to be wrapped in oooff to and Salesforce has a custom query library that you can use so it’s called soql and you have a lot of flexibility there you can actually query it almost like any other relational database like SQL or mysql so that’s totally fine right you should be able to write a custom module and I think this presentation is ended early or you could do this the easy way there’s already a really really good module out there called the Salesforce well they call it Salesforce suite of modules will just call the sales course module for short at / project / Salesforce so this module is mostly maintained now by our friends at think shout it is very well maintained and it handles all of that difficult part for you it definitely has its limitations but it is far and away the best and easiest way to connect Drupal to Salesforce I have heard of some organizations doing other kinds of integrations I have definitely heard of

at least one organization that did write their own custom Roth to Handler and their own custom soql handler and then a series of custom modules for each integration that sounds like a really special layer of hell and I would not go there voluntarily I have also heard of organizations doing things like they’ll use visualforce to set up a custom page in Salesforce and use oh I forget what is it called sales forces custom language apex to create a query that puts out XML and they’ll have an intern log into Salesforce once a week download this XML and then bring it into Drupal with feeds module or migrate module that also sounds like a really stupid idea to me if you’re going to do that amount of manual intervention then just have the intern do double entry in the first place and go home early so what we’re going to be talking about today is really focused on the Salesforce module it is far and away the most capable option here so the Salesforce suite is actually five modules and they all work together so I mentioned before all your requests have to be wrapped in oo auth to fine so there’s a module that handles sales forces particular implementation of OAuth 2 and actually looking at this I realize I have the logo for OAuth one but don’t let that fool you there’s also a module that’s called Salesforce soap that’s because Salesforce actually has two sets of AP is one that’s a rest-based API wants a soap-based API neither one of them is complete in terms of access to the data so the Salesforce module combines both of them those two sound very technical and they are and you never need to worry about them as a normal Drupal site administrator there those two models are what allow you to have the next three Drupal the Salesforce mapping which means you take a Drupal object on one side and a Salesforce object on the other and say field one goes to field1 field2 goes to field c and so on and so forth then there is sales force push which is responsible for getting data from Drupal and pushing it up to Salesforce and Salesforce pole module which is just the opposite getting data from Salesforce pulling it down to Drupal so that’s a nice technical overview but you know for those of us who are more in the strategy side or more on the site administrator side you got to know what it really actually does for you so the the strength of Salesforce module is in direct one-to-one mappings between Salesforce objects and Drupal entities pushes can happen immediately it can happen immediately as soon as something is updated in Drupal it can respond and send that up to Salesforce polls are run normally on cron which means their time delayed so typically about an hour’s delay the most important part here is one to one mapping between Salesforce objects and Drupal entities that is the number one gotcha and difficulty point so one to one mapping I mean work something like this this is a series of Salesforce contacts this is those contacts as Drupal users Salesforce Drupal wax on wax off as long as it’s one object on either side then you’re probably going to be okay what sales force doesn’t module doesn’t do very well is having one too many so here are our Salesforce contacts and we want to connect some of the information into Drupal users and some information into Drupal profiles and some information into Drupal shopping carts it’s not good at that that’s actually really tricky for it this is the form that’s the main place you’re going to be working when you’re using the Salesforce module and this gives you an idea of exactly what I mean by one to one again so it’s quite a simple form you say this is the kind of entity in Drupal it’s a node this is the kind of bundle and reports an event that’s a content type is event sales force it’s an event in Salesforce now Salesforce objects can have types and the supports filtering based on what type it is but you really start with one Drupal entity bundle or content type matches with one Salesforce object beyond that all you get to do is say here’s the title field from Drupal and it goes to the event name field in

Salesforce and you can add as many of these mappings as you like oops did not need to open that for more detail so what does this mean when we’re thinking about this strategically it means you have to think through your how your objects in Drupal map to your objects in Salesforce with a mind to catching red flags and there are red flags throughout this there’s some things that are so easy in this module and some things that all of a sudden you have to deal with custom code so for example we just mentioned that multiple what that one too many relationships are not are not really well handled they’re not handle it all in the UI that’s tricky because we do that a lot in Drupal for example it’s really common on most websites that involve user profiles to separate out the users login information their name email address password from their profile information human readable name address favorite color profile picture that sort of thing a lot of that has to do with with the fact we like to use the profile to module for some legacy reasons doesn’t have to be that way but it’s really common that we have these things separated another example is donations which could be handled any one of about five ways off the top of my head and most of them involve separating out the different steps of the donation in two separate kinds of entities another really common example would be content authors on a node entity it actually only stores the ID number of the author so if you want to be taking data from that all of a sudden you’re dealing with two entities rather than one for example if you want to put the author name of an event into Salesforce another thing that’s tricky and I mentioned here is nonentity objects now there aren’t a ton of those left in Drupal 7 one of the great things in d 7 is the universality of the entity model but they still do exist in some surprisingly common places the example I give up here is the big gotcha to watch out for which is the webform module the webform module which is one of the most popular modules out there for Drupal it does not store submissions as entities that means that you don’t have any you have no way to synchronize web form submissions with any object in Salesforce there are also some timing considerations that you have to bear in mind so remember that I said Salesforce poll only happens on cron it only gets information from Salesforce periodically every hour on the hour or so that might be difficult in some situations where you want to allow an account representative for example to modify the Salesforce contact and have that propagate over to the website in time the Salesforce module is intelligent about how it resolves conflicts so if in the meantime the user gets on and modifies their profile it will take the most recent version but it’s still not a great expense for the user to get off the phone with customer service and find that his changes haven’t been implemented most of the time I’ve only seen this in really specific situations it also means we have to be careful about our module choice so I mentioned a couple times we have to lean very hard on Drupal entities instead of web form let’s use entity web entity web form of web form entity there’s only one module I just don’t remember what order it goes in if there is a web form module that stores all of the responses as entities that makes them easy to synchronize it is worth if you have anybody with development ability on your team it is worth to check into how modules are storing their data you actually can’t assume that they store them as entities it’s also worth considering some things that would be extra complexity if you were only thinking about the Drupal side of things and I call this here mapping difficult data to a custom entity yourself so on a code level that would mean creating a special kind of entity that is just there to be a something of a repository for data that’s coming from nonentity sources like web form submissions or donations or whatever on a larger scale for really complete integrations it’s not uncommon to use the red hand CRM which is a Drupal based CRM happens to be maintained by the same people that do so much work on the Salesforce module and they’ll integrate

the entire Red Hen CRM in a way that it is totally invisible to the user and Drupal administrator and it is only there to provide intermediate objects so that those that synchronization to Salesforce can be easy and in the end custom code is almost always required I I still haven’t found many use cases where I’ve managed to avoid one too many object mappings but there are also some key differences in how Drupal and Salesforce store their information one example you can see on the right here was trying to synchronize countries from Drupal country codes for a location field and Drupal likes to store them as two character that the iso standard two-letter country codes salesforce toast salesforce stores them as long names so you could see here I have to do country get list and try and find the two-character abbreviation for each long name even worse salesforce uses a non-standard long name for the United States the single most common one in that particular database so I had to say no specifically if you see united states of america this is the two character code that kind of data translation problem is really common one that i can almost guarantee you’ll run into is here at the bottom which is that Salesforce stores checkboxes boolean fields differently from Drupal so if you’re trying to synchronize anything that is a checkbox in Drupal with a checkbox on salesforce you have to do a bit of translation in this case this is the user status field sales force I think it stores it as either the field doesn’t exist on the contact or if it does it has the word true in it if I remember right so we had to translate between being totally empty and having anything at all in it the last thing that’s a real gotcha is remembering that field data validation can be different between Drupal and Salesforce these are systems that are architected for a different purpose so the number one example that I come come across all the time is if you’re going to synchronize users in Drupal with contacts and Salesforce that seems to make a lot of sense except Drupal users have to have an email address that requirement in our data model and it will throw ugly sequel errors and Drupal errors if you don’t have an email address on the Salesforce contact email is not a required field you’re allowed to opt out of submitting your email so you might find on your first sale sports that you get a lot of real ugly scary messages and it’s just because you have users that don’t have email addresses another actually favorite example is from a sink where they had a field for website I thought that’s great well we can use a link field and Drupal that takes a website just fine and it turns out that on the salesforce side some of the records had values like give us a call and we’ll tell you or being updated check back later that gave me a few hard to diagnose issues in Drupal as well so you have to watch out for that stuff and I can more or less guarantee you’ll have some of it so how do we plan for a Salesforce integration well we start with the divide and conquer methodology where we try and separate out the responsibilities of the front-end web site Drupal from the responsibilities of your back-end Salesforce it can be tempting to mix and match and say for example well we have a form a web to lead form from Salesforce and we just have to show that in Drupal or we can have a Drupal node edit form and we just embed that in a visualforce page in Salesforce this is a really bad bad idea kind of like oh no that’s not the slide that I was expecting this is divide and conquer this is the really bad idea slide kind of like this poor girls fingernails it looks kind of cool and it’s possible to make your Salesforce interface in your Drupal interface look sort of cool together maybe you make a visualforce page that looks like a sales for like a drupal page but just like the fingernails it takes a lot of effort to make it happen and even more effort if you want it to last more than 24 hours my lecture notes for this a terrible terrible no good very bad idea which should give you

an idea of how I feel about it so we’re going to use the divide and conquer methodology which is we’re going to try and think like our users and use that as a proxy for the functional divisions between what Drupal needs and what sales force needs we’re going to do a few quick user sketches here kind of like you do in a full definition phase so first up we have Gus tomor he’s our customer right Gus tomor I hope you hope you guys appreciate the enormous amount of effort I put into these names this is the bulk of the presentation for me let me tell you so gust Homer wants to register for events he wants to maintain his user profile he wants to manage his registrations his newsletter subscriptions basically is a bunch of different ways that he wants to be able to interact with the brand and he wants those all to be exposed through the website in a reasonable sort of way next up we have an oolitic seeeeee anybody here with Irish relatives maybe you happen to have some family who are the Oh lytic family well n is a very well-known analytics analyst she is interested in getting her Salesforce data into her analytics reports I use Google Analytics here only as an example because you have a lot of flexibility and getting data from Drupal into your analytics there she wants to be able to track the success of marketing campaigns that are generated in Salesforce in sight outcomes in terms of who actually comes to the site and she’s also interested in doing something like a be testing trying to show different content on the website based on what we have in the user Salesforce profile this is Cal center I I really started to reach for the names so cal centre wants to have a nap apparently according to his picture he wants to be able to see up to the minute information about how the customer I’m happy the forum one is dropping a an LOL in the channel here he wants to be able to see how how the customers are interacting with the website this means ideally if if somebody has been clicking on the website trying to figure out how the heck to get the donations to work and then phones in cal should be able to see that that was the behavior he also wants to be able to update customer profiles quickly when they call this should right away set off that red flag of the rabbit well I guess it’s hair the rabbit with a cloth stopwatch at the minute there’s time involved especially trying to get data from the back end this should make you start to start to wonder how you’re going to make that happen finally we have my favorite name Sally’s for shipment sale these say Lee’s force of men I should have spelled it differently anyway um you know you try and come up with a name like this is very difficult so she wants to first of all finish her lunch without being bothered she wants to build reports on customer interactions from the sales force side of things she wants to make sure that the user profile information she’s using in her reports is accurate and complete and she wants to include user interactions on the website in her reports so for example to be able to say well of people who have visited our page on the Syrian refugee crisis such and such a percentage have donated this month and this is their response to our newsletters so on so forth so this information I like to lay out in a document something like what you’re seeing on the right here note that it’s ugly I actually made this a little bit fancier than usual for you guys if I don’t have to if I have to put this in only a technical facing document I another not a client-facing document then I’ll usually do this on my desk pad and just take a photo and upload it to our wiki but if it’s going to be client-facing and of course you make it look nicer this is mostly about the exercise this is all the kind of stuff that you think oh I can skip over this I know exactly what we need I think it’s important to go through the exercise

because this is how you find those red flags it’s how you make sure you have a really complete listing of things that are going to come back and bite you so first of all you can see on the Left I’ve called out kind of obviously okay the customer wants to work with drupal analytics person wants to work with drupal call center and Salesforce admin are interested in working with Salesforce on the right is the map of what information you’re going to then need in each system so you can see that even though I’ve got a one to one object Association here that’s pretty obvious sometimes the information needed isn’t one to one it’s a part of why this exercise is important if I’m only thinking about the user profile information in terms of what it what is needed on the front end part of the website I’m going to forget about some of the a user profile information that we want to be tracking in Salesforce and vice versa so for example newsletter subscription on the front end web site I only need to be able to show the user that they’re subscribed for Kam’s favorite newsletter or Kam’s birthday wishes I one of those excellent news letters that are totally fascinating I don’t care when they subscribed on the salesforce side i’m very interested to know this the newsletter subscription rate when they subscribed probably even other information like where the user came from so this next phase of this planning document is to make sure that I have these fields more or less available on both sides so that date field I need to remember that that’s got to be synchronized from the drupal newsletter subscription date means i have to store it somewhere in drupal usually i’ll do that with a different color this is this gets you nine percent of the way to a big to thinking about leaving breadcrumbs for all of your user interactions especially on the front front end web site is this more or less what we’re doing we have to be thinking about what information people want to see in Salesforce and making sure their bread crumbs there for there for people to get and actually vice versa what information we want to have accessible in Drupal or analytics package that’s based on Drupal and making sure that our breadcrumbs for that in Salesforce again these are all steps that it seems like you can just do really quickly in your head and i encourage you to avoid that that shortcut mentality every time I do this and I take the time to write it out I find a few gotchas in advance that would have caught me later on and finding out about the gotchas in advance means that your estimate can be accurate so what this comes down to is building a list a list that specifically ends up calling out what are the different objects that will be synchronized so when do we have one too many also what are the different types of fields types of fields important because that’s where you’re going to encounter those field field validation issues that i mentioned earlier or those field data storage issues and once you’ve dealt with that country name in issue once it doesn’t matter if you have five or five thousand country fields to synchronize the difficult part is done that’s going to be really important to your ability to estimate so estimation for content synchronization with anything not just Salesforce it’s a lot like estimating content import or migration and that it’s easy for it to seem like magic or like it should be more of an art than a science basically we’re going to go down that list of fields and figure out where does the mapping look simple and where does it look like it’s a little bit problematic the last time i did a synchronization like this that field list caught a really good one for me that in salesforce they were storing event date and event time in separate fields and i don’t know why but they were in drupal of course date time is one field just looking at that in a list i was able to say okay that’s going to be a problem and that needs specific estimation generally we encourage you to stick to the principle of estimates small things and add them together small estimations tend to be accurate and I think the scrum people are completely right that if you find yourself trying to ballpark an entire migration something enormous like that you’re just going to be wildly off so look down your list for problematic mappings one too many mappings count the total number of fields you have that can be reasonable give you a reasonable idea and if you

want to have a rule of thumb which I encourage you not to use I myself use about a quarter day for each unique type of field and two days for each one too many mapping that’s really rough and of course the last point here is the most important always overestimate it’s really easy to go to a client and tell them you know this took a third of the time that I estimated it’s very hard to tell them it’s going to take three times the time that I estimated so Tina could you give me a time call if we have time I’d love to show you building a simple integration yeah we’ve got I’d say about 20 minutes so go ahead great let’s do it so I’ve got a local Drupal site set up here good i still have access to it this is basically completely vanilla the only thing I’ve done here is I have set up local tunnel to access it over HTTPS or better make sure that that’s what I’m doing that’s because Roth too oh yeah that’s working it just looks ugly another window i’m just going to sneak in and clear cache here because if there’s one thing that’s going to be more frustrating than dealing with a complicated user interface in the drupal back end it’s going to be doing it without any styles well that’s not very good well you guys are going to get to actually see a little bit behind the curtain here so my local tunnel expired so i have to update on the salesforce side this is actually it’s a bit of a pain in the butt to develop for the Salesforce for any o auth to based system on a local development environment and that’s because oauth2 requires that your that the site your Drupal site in this case has to be accessible to the outside world over HTTPS and most local development environments are not so here I’m just going into the Salesforce app that I set up for this there are instructions for the how to grade this included with the module oh boy I don’t remember it taking very long but that allowed two to 10 minutes might bite us in the button we might have to do some blue skying first and then circle back to this but on the plus side now we have a theme whoo all right so we have sales forces already authorized this website is allowed to connect to my sales force application I’m going to avoid pressing the authorize button or doing anything that requires authorization for a couple of moments here to give Salesforce a chance to catch up but most of the action happens here inside structure Salesforce Salesforce mappings so you set up a series of mappings and you actually end up being able to drag them into the order that they need to synchronize because these are all 121 mappings it’s really relatively easy to deal with dependencies for example maybe I’m synchronizing users and events but events somewhere has an entity reference fields to users I need to make sure the users are synced first in that case we’re not going to do anything that complicated though we’re going to create a sales force mapping for users and you can do this with absolutely any entity an entity type so there’s entity bundle its equivalent of a content type in this case now we say which Salesforce object we want I want contact now we’re going to see if it’s allowed to connect Salesforce oh yeah okay good 12 to 10 minutes my butt all right now we get to set up our field map so this is just picking individual fields in Drupal and matching them to individual fields in Salesforce let’s use full name in Salesforce you can see that for each

field we get to choose what’s the direction of synchronization a lot of the time certain fields will be one way only either from Drupal a sales force or from Salesforce to Drupal in this case we’ll just synchronize them the other field here is key this is for marking which field is the so-called unique key on your sink unique key is the way that Drupal Salesforce module can tell that it’s looking at the right record it needs to be unique to that record in both Salesforce and Drupal so this is what I mentioned before the first instinct is always to go we’ll just use email as a unique key right each user account only has one only has email once I also run into a problem with this on salesforce because apart from not making sure that email address exists Salesforce also doesn’t make sure that it’s unique you can have 30 contacts with the same email address and Drupal does not like that one bit so we have to pick some kind of a property that is going to be unique and common solution will be to just have the drooper Drupal user ID and create a create a custom field on the Salesforce side to store it to store that since it is relevant I am going to create a custom field right now over here in Salesforce contacts wherever you are fields I mentioned well in order to have something as a unique key Salesforce actually needs to know that it is that this given field is a unique key for some external system so we’re going to create a new custom field and in fact let’s do this with email address because it is a useful Nikki all we have to do since we’re setting up the Salesforce Salesforce instance from scratch we just have to remember to not use the built-in email so we’ll call this more better email so let me remember this is the right one to use and we need to say that is always required do not allow duplicate values and set this field as the unique record identifier for an external system so I’m just going to take the defaults from for everything else here which is about who has access to edit this field in Salesforce and where should it be shown and if we go to contacts we can create a contact and we’ll see that we now have oops my creative you create new death you contact so we have mr. testing tester and there’s the more better email which is required ideally spelled correctly I’m not going to worry about any of the other fields because this is just going to be a quick demo so now we have our contact over here now one thing to note is that if you’re creating your record if you’re creating your fields on the fly like this drupal site keeps a cache of what fields are even available so it doesn’t know about my more better sales my more better email fueled yet so I’m just going to save this sort of intermediate thing it’s only half finished and we will clear caches so sorry chicks I’m going to clear all caches because the time difference just doesn’t matter on a new site that’s interesting but not something to worry about it it’s only a notice so we’ll add me the field mapping now now and there’s our more better email field down here at the bottom we’re going to think that we’re going to mark it as the key now here at the bottom we get to say what are the triggers for when a synchronization should happen i’m going to say whenever anything happens in drupal it should synchronize and it will by default try and synchronize right away and also whenever anything happens in Salesforce remember that’s always run on cron so it won’t be immediate hit

save mapping now let’s have a look at our people just make sure so all I’ve got here is administrator but we’re going to run cron which somewhat annoyingly always takes us to another page go back to people here we have our testing tester now bonus points to anybody who can guess okay I see that we’ve got two questions now so I’m going to stop in a second it almost points anybody who can guess where our first problem is it’s the status field that we didn’t have anything to sink that from so status is marked as inactive that’s something we’ll need custom code to change all right now I’m going to jump over to questions here have you had experienced sinking taxonomy terms and pick lists so applying a region through a picklist in salesforce developer SF DC i think that applies a taxonomy term in drupal oh I see so having a picklist in Salesforce that creates a taxonomy term in Drupal I that’s not something I’ve ever had to do that will be a problem for you though because pick list options in Salesforce don’t count as objects so they don’t fit in the data model that’s something that you’ll have to synchronize manually again options are not something that are generally expected to be added very often you could you could write something in custom code because I think the options should be visible to you the options should be visible to you over soql but in fact probably what I would do is have the Drupal taxonomy set to create new terms as needed created terms when one isn’t found or have a custom in my custom module say if this term doesn’t exist yet created created in Drupal second question have you had experience working with the metadata API to sync things like Nicolas values that’s absolutely related I haven’t used the metadata API but my understanding is that it’s not supported yet in in the Drupal Salesforce module again because you have an oauth2 wrapper present and you have an soql wrapper already there in fact Salesforce queries are based on the same query interface you use for drupal queries and the code level you have a really familiar interface for writing custom code and that’s what you would need to do here actually on a bit of a tangent that metadata API is one of the two things that I think are really next areas of development for this module in Drupal that seem like this should be relatively low hanging fruit the other one is Salesforce actually has a system for pinging a remote resource with an HTTP call to tell it that there’s new data that something has changed that’s not supported by Salesforce right now and it would eliminate that problem of having to wait for the next cron chron run doesn’t exist yet though those are good good questions technical though so the other thing that I want to show while we have time is what custom code actually looks like in Salesforce so this is a real real world example from one of the clients that I did this for about a year and a half ago and reply from osh and we also have a checkbox in Salesforce that sinks to the enabled flag and Drupal yes so we can enable and develop and disable drupal accounts through SF DC that’s exactly what what I’ve ended up doing in every case if I’m sinking something to an account in Drupal to a user I end up setting up a checkbox in Salesforce that says is this user active the alternative is to assume that all users are active and just having a custom module add that field that always has a value of one that’s not a terrible that’s not a terrible approach if you’re sure that they will all be active but I found in every single case the client has wanted the ability to disable that to say here’s a contact that does not need a user account so you just default that checkbox to true and it’s more or less the same thing good questions Austin Austin so this is what this is what a Salesforce hook looks like in Drupal and if you’re not that if you know have a technical type you can grab yourself a coffee for about three minutes this

won’t take long for the technical types what you should immediately see here is that this is just a pretty typical hook and the complexity of code in play is very low this thing of translating of translating country names to two letter values is not complicated here’s the sales force field that’s exactly what awesome was mentioning I found that I still needed a I still needed some translation here because Salesforce store stores boolean values or at least did when I wrote this stored them differently from how Drupal did Drupal stores the mezz zeros and one or likes to accept that into entity metadata wrapper and Salesforce will just have an empty value or if I remember right the actual word true or yes or something like that here is the example that I mentioned before if it’s a URL let’s make sure that it’s actually a valid URL this is basically copied from what the link module does and here is that combining two fields from Salesforce to make one date field and Drupal again the code isn’t terrible the terrible part is finding these things and you can find a lot of them in advance here is another really commonly used hook which is hook Salesforce query alter lets you jump in right before a query is sent to Salesforce so you can see so you can see here that this interface looks a lot like queries that you might be used to working with in Drupal so in this case I made sure that when we’re we’re querying for contacts email should always have a value and this checkbox is ewo user is always true what I also do here is add a bunch of fields this is a part of trying to deal with one to one too many in Drupal on this site we’re using the profile to module so that means that there are two entities in Drupal for everyone contact and Salesforce so I jump into the query and I add some extra fields here terrible died had to do this hard coded but sometimes that’s the way it is this is also for that multiple day date fields I see the follow up from you Austin and I’m just going to wait until we’re not in the middle of a running thought here the other half of that of that two entity solution is to have a hook Salesforce poll pretty save alter so this is right before an object is saved on sales for poll we get to take an extra action so in this case right before it saves the user object we pull out these extra values from those extra fields we added look to see is there an existing profile to object for it if yes we updated if no we create it and this is just using entity metadata wrapper there’s nothing really terrible about this it’s mostly unfortunate that you have to deal with it so long screen so Austin’s follow up follow up comment formula fields and as FDC are another alternative to combining data through code we use formulas to prep data then integrate with Drupal that is actually a really good point if you are not comfortable using code in Drupal writing custom modules in Drupal to prepare code to make those changes like the status field the status field value or combining multiple date fields or whatnot you can also do it with custom fields in Salesforce custom fields in Salesforce will let you actually write a formula that’s too much of a pain to get there from here for now lets you write a formula for what this field value should be so for example you’d have a second that second email field that more better email field is actually populated by a formula that just takes the actual value from the normal email field there’s nothing wrong with doing that I tend to prefer the Drupal make the Drupal system because it makes all of those customizations visible makes it easy for me to keep track of where they are the formulas in Salesforce smells and feels too much like code in the database for my drupal as two instincts and that’s hard to maintain hard to debug and hard to keep notes going so my preference is to do it in Drupal so just before we get to the to the

questions I wanted to throw out some blue sky ideas that are things that I’ve gotten to do or have gotten to talk to clients about arm specking now that I think are pretty cool so these are both really powerful systems right and if you actually manage to unify data between them you can do things like that an oolitic dream of AV testing and drupal based on their sales force profile i’m in the middle of specking this out for a client right now to change what is displayed on the front page for their users depending on what events they’ve logged in they’ve registered for and also what subject areas what reports they viewed what nodes they viewed on the site so if a person has viewed a bunch of a bunch of blog posts and reports and special features about the Syrian refugee crisis their front page content is going to be quietly and invisibly tilted more towards that crisis and it will change their donate call back there donate calls to action to another thing that I’m really excited about is mark is keeping track of engagement in Drupal in Salesforce so that your Salesforce can include information like as the user been commenting on posts our newsletter subscribers more likely to put to comment on posts or less likely and so on also the way you can connect Facebook with both Drupal and Salesforce offers a ton a ton of information that you can react with having users login to the site through Facebook is a really great way to get access to their basic demographic information which is otherwise a bit of a tricky UX thing to get to and finally I am really excited about personalized messages in Drupal based on users other interactions with campaigns you have to be careful about the wording for this sort of thing because it can get creepy but for example a user that’s logged in with facebook and has clicked one of our share buttons or has shared content from the web site that’s something that we can see and have access to in Salesforce and also have access to drupal to put up a message to say hey we see we see you shared our post thanks a lot that really helps or did you get that message if you get mailing if you have a mailout that’s happened from Salesforce and you can see that the user has opened it you can actually have specific messaging that’s encouraging them to check out whatever the call to action was in the newsletter the sky is really the limit here which is why I like the term blue sky when you’re when you start combining the kind of information you have about your site visitors in Salesforce and in Drupal you can make really powerful customized solutions for those customers those end users on the website and make powerful impressions on them so that’s what I’ve got for you guys I’d love to hear any questions I have only one answer 42 this is actually my first time in a long time doing a webinar and it’s totally bizarre for me that I can’t see hands up in the audience or apparently even hear you guys talking um well if there are any questions if everyone wants to use the question box and also if you wanted to Campbell you’re welcome to turn your video on I’m just going to copy and paste another another question that came through from NOAA and so I put what in the chat box there are we am I going to be using the Salesforce predictive technology announced at dreamforce we’re looking at integrating into the predictive API to grab recommended content from SF DC and display in Drupal but also display the same content and email blasts as well as a fantastic question oh oh that’s great alright and my video is on now so I’m allowed to turn off my screen right I’ll move this over so I can be talking to you so I haven’t had an occasion to use it yet I am a huge fan of machine learning and of predictive approaches machine machine learning generated are sorry machine learning driven predictive approaches to user navigation most of our projects also involve integrations with Apache Solr which if you use it right can provide also really good recommended content links and it becomes just a question of which predictive

technology do you trust more because beyond that have also been talking to some people about using the new AWS machine learning service to help predict what kind of content people are going to be interested in I think the Salesforce technology will be powerful sales force has an enormous budget to put towards this but for me it remains to be seen what ends up actually producing the best results as far as what users are genuinely interested in in seeing in fact even machine predictive predictive results sometimes are not as good as a really well-designed community recommendation system coming Gina I can I do it so I just got a big thank you from Noah mmm-hmm cool no it should be an email I would love to talk to you about this some more sounds like you really have a lot of good thoughts about this and this is like I said it’s a it’s a fun area for me cool um he says he will and there aren’t any other questions if people do have question there’s there’s a little question slide in the webinar panel there you’re welcome to type in there and get another angle of campus my contact information also if it’s useful yeah please do feel free to send me and oh you know I should have put my form one email in here didn’t think about it you can you will get a better response if you write to me at campbell at forum my personal email is your welcome to write to me there but as my wife frequently complains I never check the thing okay we’ve got one more question let’s just come in from Keenan oh great similar to the previous would it be possible to use the information from both the Drupal and Salesforce to profile anonymous users that is a great question yes and no it’s difficult to use it’s difficult to get much information from Salesforce without knowing what contact and contact profile its associated with and for an anonymous user coming to the website we don’t really get much you can use their geoip use a IP library to figure out where they are you can maybe use you can maybe use one of the libraries that analyzes patterns in pens in the browser configuration to get some idea of at least who they are uniquely leave a cookie and keep a trail of where they’ve been I’d say the biggest problems with that or first of all it’s likely to be in relatively inaccurate without really careful work I’m and quite a bit of custom work and secondly shooters forgot what my second point was and it was even stronger than the first one what anonymous information we get yeah mostly it’s because we don’t actually get a ton o secondly it becomes expensive not just in development time but also in terms of server load one of the difficult points with Drupal 7 is performance under load of an enormous amount of traffic and if you have enough traffic on your site that you’re interested in doing profiling and customization for anonymous users it becomes a real it can become a real problem for you to be generating every page it’s not it’s not impossible certainly but it imposes an order of magnitude more complexity like right off the bat I’d say if you’re going to do that then let’s use let’s see edge side includes let’s use auth cash module let’s try and minimize how many components of the website are going to be are going to be customized for those anonymous users because you don’t want one hundred percent of your traffic coming to your site to be logged in users if you can it all avoid them next question from Noah s FDC marketing cloud cookies users and brings an anonymous history and once the person identifies his or herself yeah part of does that to ya and he’s mentions this assumes the person’s using the same computer and so it has slightly mixed slightly mixed results that’s right and you need to embed its honestly also a little bit questionable tactics in terms of good for the internet and you need to you

need to include a chunk from Salesforce loading on the page as well and yeah it’s the issue that I’ve had with part is the accuracy it assumes person is using the same computer it assumes that they’re not that there’s no cookie blocking going on it assumes that it’s not a shared computer and it’s very easy for that identity to get thrown off by things like dynamic ip’s so it is possible but it would take but it takes a lot of work and I would be careful with customizing too much because I just I don’t believe that you can you can consider that identifier reliable enough okay and he says he a little bit earlier he said he agreed with you so I roll ketan thanks you as well he says these points so I know that we’re two minutes over so we are officially going to wrap this up but you do have Campbell’s information here on the screen huge thanks Campbell this is great this is a lot of information to get through in one hour but we look forward to having this conversation continue we will have more webinars coming up this is going to have recording so you’re welcome to get that will be sending that to you and hopefully we can get a chance to see campbell again soon yeah I really hope so I will be I met every drupalcon except Barcelona apparently so I’m happy to meet you guys in person or shoot me an email I love to talk about this stuff great