·
10 min read

Mars automates enterprise IT processes using Power Automate

Company profile of Mars, Incorporated
Mars, Incorporated (‘Mars’ for short), is a global manufacturer of confectionery, pet food and food products, and provides animal care services. Mars has been a proud, family-owned business for over 100 years with over 130,000 employees spread across the globe. There are several teams at Mars responsible for supporting the daily global enterprise processes. One of these teams is the Digital Demand Engineering team with employees based in North America and Europe. This team is responsible for enabling scaled engineering teams to build, operate and scale Consumer and Associate solutions over web, mobile, conversational, and collaborative experiences.

In this article, we learn about how an employee on their Digital Demand Engineering team took the initiative to use Power Automate for automating an enterprise-wide approvals process after being inspired by a colleague’s automation solution. From there, his passion for automation grew and more solutions were developed. The three Power Automate enterprise use case described in this article include:

  1. Management of access extensions approvals for an internal application
  2. User requests for provisioning of a new SharePoint site
  3. Migration of user’s network files to OneDrive for Business

 

Meet Alexander

Profile photo of Alexander Nikulin Alexander Nikulin has been with Mars since December 2009. Alexander initially worked in the maintenance stock room and was responsible for spare parts and had business user experience with an enterprise application. This eventually led to his next roles in IT projects such as working on an SAP project.

In 2018 Alexander moved into a more technical hands-on role as a Collaboration Area Lead in the Enterprise Collaboration team where they primarily work on the Microsoft collaboration services offered by SharePoint, OneDrive for Business and Yammer. It was in this role where Alexander was introduced to the Power Platform by a colleague who was building automation solutions with Power Automate cloud flows. This inspired Alexander to start learning Power Automate and building his own cloud flows. An example was automating the weekly matches of their football team by sending email reminders and saving the responses in SharePoint. After gaining experience, Alexander built several automation solutions to improve enterprise processes such as managing access of users for an internal application and enabling users to request for new SharePoint sites to be provisioned. He also started to nurture others in becoming automation experts in their line of work.

In 2021, he was promoted to Collaboration Architect in the Digital Demand Engineering team as a result of his Power Automate experience and improvements made to several enterprise processes. He is now responsible for the solutions his team develops using Power Automate, Power Apps and SharePoint.

 

Power Automate solution – Automating access extension approvals

The first enterprise automation solution Alexander developed was for automating user access extension approvals for an internal application used as a collaborative platform at Mars. Certain users have a set period in accessing the internal application which can occasionally be extended. Prior to automating this process, it was manual and time consuming. Several users overseeing the user access process had to monitor the termination date of user access and continuously follow up with line managers on whether their access should be extended.

Alexander developed two cloud flows in Power Automate to automate the user access extensions. The first flow is a scheduled daily cloud flow that checks a SharePoint list where user data is stored to evaluate whether a user’s access termination date is near and generates the approval and reminders. If the termination date is within 28 days, a second cloud flow is triggered that sends the required information and generates an approval which is sent to the line manager to remind them that the user’s access to the internal application is ending and confirm if the user’s access should be extended.

Second cloud flow triggered when it is 28 days prior to the user’s access termination date and waits for an approval or rejection, followed by updates based on the approver’s decision.

Second cloud flow triggered when it is 28 days prior to the user’s access termination date and waits for an approval or rejection, followed by updates based on the approver’s decision.

 

Secondary reminders are sent 14 days and 7 days prior to the user’s access termination date if the line manager does not respond to the initial reminders. If no response is received or the senior line manager rejects the extension, the user is removed from the Azure Active Directory group. Otherwise, if the line manager approves, the cloud flow performs the necessary actions to extend the user’s access to the internal application.

Automated access extension approval for the internal application.

Automated access extension approval for the internal application.

 

“My managers and my peers were impressed that such a solution can be built using Power Automate.”

– Alexander Nikulin, Collaboration Architect, Mars

 

Summary of benefits and impact

The automated access extension solution processed over 500 approvals in the first two years of going live and has improved the management of users who need their access extended.

  • Line managers are automatically notified based on reminders which reduces management overhead
  • Minimal disruption for users as their user access is extended through automated line manager approvals
  • Automation minimizes the possibilities of human error in missing extension requests for users

 

Additional Power Platform solutions

Request for provisioning a new SharePoint Site

Alexander automated two aspects of SharePoint site provisioning at Mars by using Power Automate and Power Apps:

  1. Automating the creation of new SharePoint sites using Power Automate.
  2. Improving the user experience for submitting new requests. This was achieved using Power Apps.

Alexander’s colleague who originally developed the legacy code for site provisioning recognized that it was outdated and complicated. Since Power Automate supports hundreds of connectors, Alexander’s colleague suggested that he use Power Automate cloud flows to improve the site provisioning process.

Alexander developed a cloud flow that runs every hour to identify the new requests submitted that are stored in a SharePoint List. The cloud flow then calls the SharePoint REST API to create the new SharePoint sites. Finally, the business user is notified that their requested SharePoint site has been created.

The Power Platform solution that automatically creates a new SharePoint site from the requests submitted via the canvas app.

The Power Platform solution that automatically creates a new SharePoint site from the requests submitted via the canvas app.

Next, they looked into improving the user experience for submitting requests. Previously, user requests were submitted through a legacy Azure web application. The user interface was developed at a time when user experience was not valued and therefore was sub-optimal. The legacy application could not be modified for enhancements, failed to load for users at times and required manual monitoring of the sites created.

Alexander turned to Power Apps to modernize the process and user experience. Power Apps was ideal due to its feature rich user interface capabilities using low code and its integration with Power Automate. A canvas app was created which became the front-end interface for user requests and it modernized the end user experience completely.

For quick access, the app is launched from an intranet SharePoint page to submit their request. Users then proceed to provide details of their request in the app: justify the business reason for a new SharePoint site, who the backup owner will be, internal or external access for the site, the template to be used for the SharePoint site, and the site details such as Title, Description, Region etc.

Users launch the canvas app from their intranet to request for a new SharePoint Site to be created for their business.

Users launch the canvas app from their intranet to request for a new SharePoint Site to be created for their business.

The following are some key capabilities of the solution that made it a more modern and guided user experience:

  • A progress bar visualization at the top of the app to guide the users in each step.
  • Users can select their template preference for the SharePoint site.
  • Site URL validation is implemented using a second cloud flow that calls the Graph API to check if the site URL provided by the user in their request already exists. If it exists, a warning is displayed to the user to prompt them to provide another value for the site URL. This eliminates duplication errors that lead to site provisioning failures prior to the actual creation of a SharePoint site.
  • Users can also provide feedback after they submitted their request, allowing Alexander and his team to continuously improve the end user experience and functionality of the app towards the user requirements.

User confirms details and provides a new site URL if it already exists prior to submitting their new SharePoint Site request from the canvas app.

User confirms details and provides a new site URL if it already exists prior to submitting their new SharePoint Site request from the canvas app.

A summary of the benefits and impact of the solution is as follows:

  • Low code design which provides flexibility in updating the processes for SharePoint provisioning and the end user experience for submitting requests.
  • Modern user experience in submitting requests for provisioning of new SharePoint sites.
  • 100-150 SharePoint sites are now provisioned monthly.

 

File Share Migration

Like any long-standing company, Mars operated with servers where enterprise applications and file management were on-premises. As technology advanced, on-premises applications evolved into cloud applications and likewise with file management – cloud services became the standard. Mars adopted Microsoft 365 a few years ago and saw the potential of moving files to the cloud to reduce maintenance and server costs. Storing files in the cloud also proved to be valuable as employees could easily access their files from any location and any device and provided greater storage capacity than their file management on-premises.

To transition to cloud file management, Mars initiated a project to migrate employee files from their personal network folder to their OneDrive for Business folder. A tool known as ShareGate was used for the actual file migration using PowerShell scripts. These PowerShell scripts were manually created for each migration which was time consuming since over 25,000 folders needed to be migrated. To speed up the migration process, Alexander and the team developed an automation solution using Power Automate cloud flows to help generate the PowerShell scripts.

This solution includes six cloud flows connected to four SharePoint Lists (Batches, Users, Sessions, Errors) and two document library folders (one for PowerShell scripts that process CSV files and another for migration reports for each user). Multiple iterative versions of the automation solution were developed over time to improve the technicalities of the process.

The cloud flow utilizes Microsoft Graph API and intelligently creates PowerShell scripts where relevant for the migration of files to OneDrive for Business.

The cloud flow utilizes Microsoft Graph API and intelligently creates PowerShell scripts where relevant for the migration of files to OneDrive for Business.

The automation process is as follows:

    • The cloud flow uses the Microsoft Graph API to validate whether the users already have OneDrive for Business provisioned.
    • If the OneDrive for Business has not been provisioned for the users, the cloud flow is paused and sends an email to the analysts. It also provides them with a list of users who do not have OneDrive for Business yet.
    • The analysts are then required to run the PowerShell script automatically generated by the Power Automate cloud flow to provision OneDrive for Business for the users.
    • Once the analyst has executed the PowerShell script, the Power Automate cloud flow continues with processing the necessary actions.
    • Using Microsoft Graph API, a default folder is automatically created for each user which is the target destination of the migrated files from their personal network folder.
    • A SharePoint list has been utilized for audit purposes to keep track of the migration of user files, the size of their files, the OneDrive for Business URLs of the folders created, and any errors encountered.
  • Another PowerShell script is automatically generated which is sent to the analysts to execute on the network server to migrate the files from user’s personal folder to their default folder in OneDrive for Business.
  • Best practice of error handling was also implemented in the PowerShell script using the Try, Catch, Finally method. Whenever an error occurs a Power Automate cloud flow is triggered which saves the error details into the SharePoint List.

The Power Automate cloud flow checks if a user has OneDrive for Business and if not, performs the required actions to provision OneDrive for Business for the user.

The Power Automate cloud flow checks if a user has OneDrive for Business and if not, performs the required actions to provision OneDrive for Business for the user.

The automation solution enabled Mars to successfully migrate files for over 25,000 users from the network folders to OneDrive for Business, reducing the time spent on manual work and with less errors.

The file share migration initiative will also expand to moving department files to SharePoint online as Mars continues to see the value in online file management. This will be a future project to continue with their progress to operating in the cloud to transition away from on-premises.

 

“Finally, we have this version – it has worked brilliantly, no issues. It was quite a long journey, but from my perspective that is the most complicated automation I have ever created so far because it is really long and there’s a lot of dependencies.”

– Alexander Nikulin, Collaboration Architect, Mars

 

Accelerating Power Platform adoption at Mars

In 2021 a companywide Power Platform hackathon took place with many teams around the world participating. These teams gained firsthand experience in designing and building business solutions with the Power Platform. Many saw the value of developing low code solutions rapidly which later led to an increase of automation and apps. Today Mars has approximately 10,000 cloud flows and 4,000 apps.

Alexander has been instrumental in enabling others at Mars to develop Power Platform solutions. Not only was he a coach for the Power Platform hackathon, but he also regularly participates in sessions to demonstrate automation solutions to inspire others at Mars to think about how processes within their line of work can be automated. Other colleagues in the collaboration related teams have since followed in his footsteps by developing Power Platform solutions for unified services, desktop devices etc.

To help govern and administer the increase of solutions being developed across the company, a Centre of Excellence is currently operating which Alexander, and his current team are involved with. They recognize that it is important to manage the growth to ensure company policies are followed but also harnessing the value of employees developing their own processes that fit their requirements.

 

“Once you give them the tools, they will be able to build great solutions for their departments, businesses, areas, countries because they know their business much better. They know exactly how they are supposed to work and combine technical knowledge and eagerness to learn and build something with business knowledge. It can produce a great result, but at the same time it is important to control when you have over 10,000 cloud flows and over 4,000 apps in your tenant.”

– Alexander Nikulin, Collaboration Architect, Mars

 

Looking ahead

To continue supporting the growth of Power Platform solutions at Mars, Alexander and his Digital Demand Engineering team are working on materials which will be accessible from their internal hub site. Several types of materials will be made available such as learning and training resources, FAQs and much more. Alexander is planning to run monthly webinars to help educate others on how to build effective Power Automate cloud flows. Alexander and his team also plan to explore other Power Platform services such as Power Pages to expand on digitizing their business processes at Mars.

 

“Anyone can (no-)code. Everyone should (no-)code.”

– Sandeep Dadlani, Chief Digital Officer, Mars

 

Related links