Files Connect

The joy of preparation for another certification, learning all the things you kind of heard about or didn’t hear at all. And now you need to understand them in deep dive, if possible.

Files Connect is such feature – I knew about it, I set it up for one client a while ago but never really paid attention. But the more I play with it the more I like it. Every company already has their system for sharing files being it Google Drive, Microsoft SharePoint, Box or any other solution. And at least the three I mentioned is possible to link with Salesforce natively.

What do you need? Admin rights for Salesforce and Google/SharePoint/Box, Professional Edition of Salesforce (and it works in Community as well) or higher and a bit of time.

The configuration is pretty easy, all you need to do is to create auth. provider, permission set, external data (yes, these are included in the licence and you can use the for external search as I wrote a while ago) and some work on the other side. Everything is described pretty well in help, which also links to documents from Winter ’17 for users and admins with more details. Especially the document for admins of SharePoint might be super helpful, it looks like it is possible to create a link with SharePoint which „auto-populates“ files for all records in Salesforce without doing much extra work (meaning users don’t have to add them manually), which is super cool (page 71 and further).

One of the bigger decision at the beginning might be whether to reference files in original storage or copy them to Salesforce but I would stick with SF recommendation – just reference them, you will get better value.

How it works?

You set everything correctly and now whenever you want to add a new file to a record, you can choose from external storage.

Google Drive as additional library

Nope, you cannot upload file directly to external storage via Salesforce, but here is an article which shows you how to develop such component, so you might be able to save some work of your users.

Salesforce always links (if you use the reference mode) to the latest version of the file, but it looks like it index it for searching at the moment of adding into SF for the first time (I was able to search the linked file, but it didn’t work when I updated the text in them). It can also support the access rights you set on the external storage – when defining the external data source you specify whether you have user based credentials or universal one, in such case (user based) the user can see the link to the file in SF but cannot open/preview it.

When the file disappear from the external storage (it is deleted or you lost access rights), the link still exists in Salesforce but you will get an error when you try to open it. BTW: Salesforce supports preview even for external files, which is pretty cool.

If you use the copy style, the moment you attach it to Salesforce it gets copied to Salesforce and it looses the link to the external storage – you can update it in SF, it will stay here even when you remove it from the other side.

We used it in Classic and it blocks us from Lightning

In Classic something similar existed. You could add a direct link to Google Drive as an attachment and it was saved into the GoogleDoc object. This isn’t supported in Lightning and here is an idea with thousands of points, but in this case I hope they won’t realise it.

The reason? You can easily migrate the old links into proper file structure, just take the GoogleDoc object and upload it to ContentVersion object – ParentId will become FirstPublishLocationId, Url goes to ExternalDocumentInfo1, you probably need to set ExternalDocumentInfo2 to file: and id of the file from the url and that should work. Nothing super hard and not a reason for Salesforce to waste their resources.

Get to clients

Now I need to send a link to this article to my clients, I hope some of them will appreciate it. And what about you?

Leave a Reply