Article Contents
Introduction
When a new project is lodged in Hiro, the system automatically sends out an email notification. With Microsoft Power Automate, you can use those emails to automatically create a matching project folder in SharePoint. This means your job files are ready and waiting without anyone needing to set them up manually.
Before You Start
- Microsoft 365 account with access to Power Automate and SharePoint
- A SharePoint site and document library for projects (if you don’t already have one)
- Permission to create and manage flows in Power Automate
Setup Sequence
Step 1: Setup Hiro Notifications
For this automation to work, the person who sets it up in Power Automate must always receive new project notifications from Hiro.
- In Hiro, go to Settings > User Privileges & Notifications
- Select the Projects tab
- Under Project lodgements and conversions, add the name of the person who is setting up the automation
- Save your changes
⚠️ Access to User Privileges & Notifications is restricted to Hiro Global Administrators. If you don’t see this option, ask your Global Admin to add you.
Step 2: Decide Your Folder Strategy
Decide how you want your jobs and enquiries organised inside Sharepoint:
-
Separate – keep jobs and enquiries in different top-level folders. This is helpful if you treat them very differently.
Documents (SharePoint library) ├── Jobs │ ├── 6037 - Stanthorpe (Spacely Sprockets Pty Ltd) │ │ ├── 01 Admin │ │ ├── 02 Client │ │ ├── 03 Drawings │ │ └── ... │ └── 6040 - Toowoomba (Land Grab Corporation) │ └── ... └── Enquiries ├── E1041 - Brisbane (Jones Property Group) │ ├── 01 Admin │ ├── 02 Client │ ├── 03 Drawings │ └── ... └── E1042 - Roma (Smartex Solutions) └── ... -
Together – store enquiries and jobs together and rely on folder names to tell them apart. Simpler for smaller teams.
Documents (SharePoint library) ├── 6037 - Stanthorpe (Spacely Sprockets Pty Ltd) │ ├── 01 Admin │ ├── 02 Client │ ├── 03 Drawings │ └── ... ├── 6040 - Toowoomba (Land Grab Corporation) │ └── ... └── E1041 - Brisbane (Jones Property Group) │ └── ... └── E1042 - Roma (Smartex Solutions) └── ...
👉 Whichever option you choose, be consistent so staff always know where to look.
Step 3: Make Sure You Have a SharePoint Site for Projects
If you already have a Projects site with a Documents library, you can skip this step and move straight to Step 4.
If not, you’ll need to set one up so Power Automate has somewhere to create your folders:
- Create or use a Team site – this is designed for day-to-day collaboration. We suggest calling it "Projects". (Avoid Communication sites, which are better for publishing.)
- Inside that site, you'll use the default Documents library. Project folders created by Power Automate will sit inside this library.
If you chose Separate in Step 2, Power Automate will later create top-level Jobs and Enquiries subfolders within this library.
Step 4: Create the Flow in Power Automate
- Open Power Automate
-
Choose Create > Automated cloud flow.
- Set the trigger to When a new email arrives (V3).
- Mailbox: the person who receives Hiro “new project lodged” notifications
- Subject filter: has been lodged
-
From: messaging-service@ourhiro.io
Step 5: Decide How to Route Enquiries vs Jobs
This step only applies if you chose Separate in Step 2. If you chose Together, skip this step and go to Step 6.
If keeping them separate, we will set a variable that says whether the email is an Enquiry or a Job, based on the email body.
Hiro sends three flavours of emails for new projects:
New enquiryHelloI have just lodged new enquiry
Converted enquiry (becomes a job)HelloI have just converted enquiry
New job (lodged directly without enquiry)HelloI have just lodged new job
5.1 Convert the email body to plain text
- Add action → search for Html to text and select it.
- In the Content field:
- Click inside the Content box.
- The panel on the right will appear with the blue Data button and the fx Expressions button.
- Click the Data button.
- Under your email trigger, click Body.
- This inserts the HTML body token from the incoming email.
-
Do not choose Body preview for this step.
5.2 Set where this item should go
Now we’ll tell Power Automate where to put the folder by setting a variable called RouteFolder.
-
Add action → Initialize variable
- Name:
RouteFolder - Type: String
- Value:
Jobs -
(We start with “Jobs” as the default.)
- Name:
-
Add action → Condition
- In the condition, click into the Choose a value box.
- From Dynamic content, select the output of your Html to text step.
- In the middle dropdown, select contains.
-
In the last box, type:
I have just lodged new enquiry
-
Fill the condition branches:
-
If True: Add an action → Set variable.
- Variable:
RouteFolder -
Value:
Enquiries
- Variable:
-
If False: Do nothing.
- Because the variable is already set to
Jobsby default, this covers both:- “Hello I have just converted enquiry”
- “Hello I have just lodged new job”
- Because the variable is already set to
-
If True: Add an action → Set variable.
👉 Result: After this step, the variable
RouteFolderwill always equal either Jobs or Enquiries, ready for use in Step 7 when you create folders.
Step 6: Build the Project Folder Name
- Add a Compose action called
FolderName. -
Click into the Inputs text box, and then click the blue Insert expression icon that appears to the right of the text box.
- In the popup expression panel, paste this exact Expression, which cleans the job number and description from the subject, removes hidden characters, and strips only the illegal SharePoint characters. Parentheses
()and curly braces{}are kept.:
trim(
replace(
replace(
replace(
replace(
replace(
replace(
replace(
replace(
replace(
replace(
replace(
concat(
first(
split(
replace(
replace(
replace(
replace(
replace(
replace(
triggerOutputs()?['body/subject'],
'–','-'
),
'—','-'
),
decodeUriComponent('%C2%A0'),' '
),
decodeUriComponent('%E2%80%AF'),' '
),
decodeUriComponent('%0D'),''
),
decodeUriComponent('%0A'),''
),
' '
)
),
' - ',
join(
skip(
split(
replace(
replace(
replace(
replace(
replace(
replace(
triggerOutputs()?['body/subject'],
'–','-'
),
'—','-'
),
decodeUriComponent('%C2%A0'),' '
),
decodeUriComponent('%E2%80%AF'),' '
),
decodeUriComponent('%0D'),''
),
decodeUriComponent('%0A'),''
),
' - '
),
1
),
' - '
)
),
'"',''
),
'#',''
),
'%',''
),
'*',''
),
':',''
),
'<',''>',''
),
'?',''
),
'/',''
),
'\\',''
),
'|',''
)
)How project folders are named
Your folders will be named from the email subject line.
- The first word is the project number.
- Everything after the first
-(dash) is the project description.
For example:
- Email subject:
6037 has been lodged (converted from enquiry E6059) - Stanthorpe (Spacely Sprockets Pty Ltd) - Folder created:
6037 - Stanthorpe (Spacely Sprockets Pty Ltd)
Step 7: Create the Main Project Folder
Add a Create new folder (SharePoint) action.
- Site Address: your Projects site
- Library: Documents
Now set the Folder Path.
👉 Important: You cannot just type or paste text directly into the Folder Path box.
- Click inside the Folder Path box.
- On the right, click the grey fx button (Expressions).
- Paste the expression below into the expression editor.
- Click OK.
Use the right one for your strategy:
- If you chose Together in Step 2:
outputs('FolderName') - If you chose Separate in Step 2:
concat(variables('RouteFolder'), '/', outputs('FolderName'))
This tells Power Automate to use your cleaned-up folder name (Step 6), and if needed, place it inside either the Jobs or Enquiries subfolder (from Step 5).
Step 8: Add Standard Subfolders (Optional)
If you want every project to start with the same set of subfolders:
-
Add an Initialize variable → Type: Array → Value:
["01 Admin","02 Client","03 Drawings","04 Photos","05 Reports"] - Add Apply to each over that variable.
- Inside, add Create new folder with Folder Path:
- If you chose Together:
concat(outputs('FolderName'), '/', item()) -
If you chose Separate:
concat(variables('RouteFolder'), '/', outputs('FolderName'), '/', item())
- If you chose Together:
Step 9: Save and Test
- Click Save at the top of your flow.
- In Hiro, lodge a test project.
- Wait for the Hiro email to arrive in the mailbox you set up in Step 1.
- Open Power Automate and check the Flow Runs (click your flow → “Runs”).
- If it shows Succeeded, the flow has run.
- If it shows Failed, click into it to see where it stopped.
What you should see in SharePoint:
- A new folder created under the Documents library.
- The folder name should be the project number and description (see Step 6).
- If you chose Separate, it should sit inside either Jobs or Enquiries.
- If you added Step 8, your subfolders (e.g. 01 Admin, 02 Client, etc.) should also appear inside the new project folder.
📸 Example finished flow
Here’s what a completed flow looks like from start to finish, including the enquiry/job routing: