Skip to content

Make a DashboardTarget_Run_object_updates Flow

Michael Kolodner edited this page Dec 2, 2022 · 1 revision

I would have liked to include in this package a template flow for updating all the dashboardtargets once per day. But that flow has to be based on the subflows for each object. And you can't include one of those subflows in in the flow unless it's active, which means I would have to ship the subflow(s) active just to ship this scheduled flow.

Instead, let me show you how to build your own flow that can update all the dashboardtargets in your org! Actually, we're going to build two versions, one for use on-demand and one that will be scheduled to run, probably once per day.

On-Demand Updates

We'll build the on-demand version first. This is really a very simple flow: DashboardTarget_Run object updates flow

  1. Create a new Autolaunched Flow (No Trigger) and name it DashboardTarget_Run_object_updates (or whatever you would prefer.)
  • Add a Pause element. This step is not strictly necessary. But putting in this pause element ensures that the actual work of the flow (updating all the DashboardTarget records) is completed asynchronously and, therefore, is less likely to hit limits.
  1. Set the pause element to Always Pause flow - No Conditions Pause Element
  2. Then click on the RESUME EVENT tab and set that to resume at a specific time, with the base time being the start time of the flow interview, and the offset being 0 Hours. Resume Conditions
  3. Last, add the subflow (or subflows) that you have to run the dashboardtarget updates for each object. In the picture above I have just one object worth of subflows (Contact).
  4. If you think you might need it, you could add additional pause elements before some of those subflows.
  5. Activate this flow.

Now you have a flow ready that will update all dashboardtargets asynchronously. This is suitable for adding to your dashboardtarget record page or Lightning page as a button, as noted here.

Scheduled Flow

Building a schedule-triggered flow allows you to have your dashboardtargets update regularly so they keep up with any changes that might happen, such as students coming or going from your program. And having already built the on-demand version it's really easy to make the scheduled version.

  1. Open your on-demand flow from above and choose Save As.
  2. Click Show Advanced and then change the Type to Schedule-Triggered Flow.
  3. Give your flow a new name and description, such as DashboardTarget_Scheduled_Run object updates
  4. Set the start date and time.
  5. Save your flow and activate it.

That's it. Your flow should run on your schedule and update all your targets. (I like to create a new auto-update target and leave its Target field blank, then the next day I can check to be sure the scheduled flow ran.)

Clone this wiki locally