Skip to content
JScheper.com
JScheper.com

BizApps, Powerplatform and AI

  • Home
  • Blog
  • Contact
JScheper.com

BizApps, Powerplatform and AI

Adding Goals in bulk

Adding Goals in bulk, simple and easy!

Posted on November 14, 2025November 14, 2025 By Jeroen Scheper

In my previous blog post, I wrote about goal management in general (link to article here). The post explains how goal management works and how to configure it yourself. Adding goals in bulk is one of the gaps I noticed while I was looking into this feature. Yes, there is always the option to go for the Excel route, of course, but in this post, I would like to demonstrate how you can build something yourself so adding goals in bulk will be simple and easy.

From a functional or process perspective, you need to decide what the philosophy is. In my use case for Padel Vamos, I would like to create the goals for an owner, for certain goal metrics, and for the remaining months of the current year.

Technically, this means that I need to create the following:

  • a new Button on the goal management form
  • a Custom page that is collecting the required information
  • a Power Automate Flow to process all of this

Add Goals Bulk button

First, you need to make sure that you create a new custom button that will eventually launch the custom page. Follow the next steps to do this:

  • Navigate to https://make.powerapps.com/
  • Edit the Model-Driven App where you want to add this button to
  • Add or find the Goals view and select the three dots > Edit command bar > Edit
  • Select Main Grid and press Edit
  • Add a button via + New > Command
  • Set the following properties:
    • Icon = either a standard or upload one yourself
    • Action =Run JavaScript
    • Library = I have built a custom library with functions to open dialogs
    • Function = openCustomPageDialog

      I will not go into too much detail on this. The JavaScript code is below, where I believe the most important bit is the name of your custom page: jsc_goalbulkadding_74275. If you are interested in this topic, then there are great people in the community who have written in detail about this, like Matthew Devaney, so check out his post about that here, since he explains it really well.
function openCustomPageDialog(primaryControl, firstSelectedItemId, selectedEntityTypeName)
{
    // Centered Dialog
    var pageInput = {
        pageType: "custom",
        name: "jsc_goalbulkadding_74275",
        entityName: selectedEntityTypeName, 
        recordId: firstSelectedItemId 
    };
    var navigationOptions = {
        target: 2,
        position: 1,
	height: {
	    value: 500,
	    unit: "px"
	},
	width: {
	    value: 50,
	    unit: "%"
	},
	title: "Goal Management - Bulk Add Goals"
    };
    Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
        function () {
            // Refresh the main form when the dialog is closed
            primaryControl.data.refresh();
        }
    ).catch (
        function (error) {
            // Handle error
        }
    );
}

Custom page: Adding goals in Bulk

When it comes to the custom pages, I would like to share again that there are great people in the community who can share a lot more about the best practices, for example, Megan Walker, who is now writing a whole series on this topic, so check it out here if you are interested in this topic.

For the creation of goals, there are a few key things that are needed, but also some decisions to make on how this can work for you:

  • Goal Owner: to whom will this goal apply
  • Goal Metric, so for which metric do I want to add the goals in bulk
  • What is the Target
  • The one that is not on this list, but was the most difficult one was the Goal Period.
    Standard, probably the easiest one is the Quarterly periods. In my example, I want to go for the custom route and do this per month 😅😁

The cosmetic changes I will not explain in detail in this post, since the most important one to explain is the OnSelect of the Save button. In this statement, we trigger the Power Automate Flow with the Guids and values of the custom page.

Power Automate Flow, where the magic happens

This is the bit of adding goals in bulk that I do like to focus on. Most of the time of this feature is spent here.

Additional information per step:
Initialize variable – Current month:

int(formatDateTime(utcNow(), 'MM'))

Initialize variable – Current Year:

int(formatDateTime(utcNow(), 'yyyy'))

Initialize variable – Last Day of Month:

subtractFromTime(startOfMonth(addToTime(utcNow(),1,'month')),1,'day','dd')

Add Goal
Name is a concatenation of Owner, Metric, Year, and Month

concat(items('For_each')?['fullname'], ' - ', outputs('Get_Goal_Metrics_by_GUID')?['body/name'], ' - ',variables('VarCurrentYear') ,'-',variables('varCurrentMonth'))

From is the first day of Month

formatDateTime(concat(utcNow('yyyy-'), variables('varCurrentMonth'), '-01'), 'yyyy-MM-dd')

To is the last day of Month

formatDateTime(concat(utcNow('yyyy-'), variables('varCurrentMonth'),'-', variables('LastDayOfMonth')), 'yyyy-MM-dd')

Set variable – Set Last Day of Next Month

The last day of the next month is being calculated from today’s date, which means varNumberOfMonths is crucial to have in order to calculate the right last date of the month

subtractFromTime(startOfMonth(addToTime(utcNow(),variables('VarNumberOfMonths'),'month')),1,'day','dd')

Overall, this was a fun experience to build, and if you have resolved this differently or have different thoughts about this, then feel free to share something in the comments.

My next post will also be on the topic of Goal Management and another gap I experienced, which will even be more fun.

Sales Customer Insights Field Services Power Apps Power Automate Power Platform Reporting Add goals in bulkbulk goalsgoal managementperformance management

Post navigation

Previous post
Next post

Related Posts

AI Builder Confidence of AI grows

Confidence of AI grows, Dutch Team will make it to the Semifinal

Posted on July 5, 2024July 17, 2024

The Quarterfinals are about to start, the Netherlands will play tomorrow against Turkey. After predicting the game against Romania correctly, the confidence of AI grows. Will it be right again is the big question. When you look at the history of this match, it was always very close. Please find…

Read More
Reporting

Enable security roles on templates is now available

Posted on April 11, 2025April 11, 2025

We probably all have seen this occasionally, you are working in an area on the platform that you know, and you all of a sudden see a new button or something else that you are pretty sure was not there before. This week I spotted a new button to enable…

Read More
Sales New customized lead qualification experience

New customized lead qualification experience

Posted on August 21, 2024August 21, 2024

One of my favorite new features that is introduced in the Wave 2 2024 release, is the new customized lead qualification experience. This functionality did not change that much over time but now you do have better options to make this process a lot smoother and tailored to your needs….

Read More

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

ABOUT ME

  • LinkedIn
  • Mail
  • GitHub
  • YouTube
"BizApps and PowerPlatform dude with a passion for AI, sitting relaxt in his black shirt on a bounty white beach with palm trees, a azure blue ocean in the background and enjoying a good coffee "

~GenAI - DALL.E 3 and GPT 3.5

Subscribe

Please wait...

Thank you for subscribing!

Search

Categories

  • Agents
  • AI Builder
  • AI Prompting
  • Artificial Intelligence
  • Copilot
  • Copilot Studio
  • Customer Insights
  • Customer Service
  • Dataverse
  • Field Services
  • Generative AI
  • Model-driven Apps
  • Personal Development
  • Power Apps
  • Power Automate
  • Power BI
  • Power Platform
  • Reporting
  • Sales
  • SharePoint

Archive

  • June 2026
  • May 2026
  • March 2026
  • February 2026
  • January 2026
  • December 2025
  • November 2025
  • October 2025
  • August 2025
  • July 2025
  • June 2025
  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
© 2024 - All rights reserved | Jeroen Scheper | Privacy Policy