Flow: Display Photo or Upload Photo

The flow will display either a photo or remind you to upload one. On any object!

How It Works:

The Flow looks for a file attached to that record with the title “SalesforcePhoto” (or another phrase of your choosing).

The File gets the title from the name of the file when you upload it. If you upload SalesforcePhoto.jpg, the title becomes “SalesforcePhoto.” You could also open the File details in Salesforce and change the title.

If that file is found, it’s previewed thanks to the work of Narender Singh, (of course)!

If not found, it asks you to upload a file from your computer named SalesforcePhoto and attaches it to that record. From then on the, the flow displays the photo!

We are using the app because constituents and donors are more than just a record, and seeing their faces humanizes the data.

Donna, Vote Solar

To Set It Up:

Check the box Pass Record ID into this variable.
  1. Install this package.
  2. Add the flow to your Lightning record page.
    1. Let’s say you want to add this to a contact page, start by looking at a contact record.
    2. Click on the setup gear.
    3. Select Edit Page.
    4. From the list of components on the left, select Flow and drag that into the right column or wherever you want.
    5. Select the flow “Contact Photo Needed.”
    6. Check the box “Pass record ID into this variable.” {!Record.Id} will fill in automatically.
    7. Save. And activate if you need to.
  3. If you want your files to be named something other than “SalesforcePhoto,” open the Flow and modify the constant called PhotoTitle (see video above).

Resources:

Narender Sigh made the component that previews files. Find that here.

Couldn’t have figured it out without Jennifer W. Lee’s blog post on using Files in flow.

Published by

JessieRymph

Jessie joined Salesforce.org in 2018 to give introductory webinars to nonprofit customers. She now is a Senior Solution Developer supporting nonprofits and education customers at Salesforce. All opinions expressed on this blog are her own or those of the contributors. She's spent 17 years more or less in CRMs and databases, but didn't meet Salesforce until 2011. Jessie co-led the Seattle Salesforce Nonprofit User Group in 2015-2016. She wrote a sh*tty first draft of a novel and hopes to turn it into a screenplay!

15 thoughts on “Flow: Display Photo or Upload Photo”

      1. Does the link take me to download your flow directly or does it take me to the AppExchange? Either way I am super excited to try your flow. I think it’s the best solution for our needs. Thank you!

  1. Hi Jessie. I have installed the package and followed the setup instructions. When I click on upload file, I am allowed to select the file, click on done when complete, then click on finalize upload. Ultimately the file is not save to the record and not displayed. I have installed into a Dev org to test.

    1. Hi Jay! When I initially upload the photo, it doesn’t show. The page needs to be refreshed, and then I see the file and the photo. I could add that to the last page of the flow as instructions. Does that do the trick for you?

      1. I tried, but the file is not being stored so it cannot be displayed… Any thoughts?

      2. Jessie

        I got the file to upload, however it is not renaming it to SalesforcePhoto. It keeps the original file name in the title…. Any ideas?

        Thank you

      3. hey! Glad to hear it worked – what did you need to do? The file needs to be called SalesforcePhoto.jpg or .png before or after it is uploaded.

  2. Hi, I installed the flow and set the photo title in the flow to ContactPhoto. I then renamed an image file that is stored in the contact’s files to ContactPhoto. This photo comes in from an online form and my use case is to display it on the page. I expected the flow by default to grab any file with the name ContactPhoto and display it. I have tried setting the file title to ContactPhoto, ContactPhoto.jpg. Nothing seems to work other than to upload it directly from my device.

  3. I just sent a post and wanted to add that it is not even working if I upload a file named ContactPhoto.jpg. I’ll keep messing around with it but so far no luck.

  4. Please disregard my question, the flow has other areas that need to have the name changed from SalesforcePhoto to ContactPhoto.

Leave a Reply