<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/" >

<channel>
	<title>SharePoint &amp; Microsoft Power Platform Tutorials &#8211; SPGuides</title>
	<atom:link href="https://www.spguides.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.spguides.com</link>
	<description>Learn SharePoint, Power Platform, SPFx, etc, SharePoint training courses</description>
	<lastBuildDate>Sun, 03 May 2026 16:44:48 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.5</generator>

<image>
	<url>https://www.spguides.com/wp-content/uploads/2022/11/cropped-spguides-favicon-32x32.png</url>
	<title>SharePoint &amp; Microsoft Power Platform Tutorials &#8211; SPGuides</title>
	<link>https://www.spguides.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>SPFx Environment Variables: A Practical Guide for Every Scenario</title>
		<link>https://www.spguides.com/spfx-environment-variables/</link>
		
		<dc:creator><![CDATA[Bijay Kumar]]></dc:creator>
		<pubDate>Sun, 03 May 2026 16:44:46 +0000</pubDate>
				<category><![CDATA[SharePoint Framework]]></category>
		<category><![CDATA[SPFx Environment Variables]]></category>
		<guid isPermaLink="false">https://www.spguides.com/?p=132838</guid>

					<description><![CDATA[If you&#8217;ve ever worked on an SPFx project with a team, you&#8217;ve probably hit this problem: your&#160;serve.json&#160;has your personal SharePoint URL hardcoded, your colleague has a different tenant, and every time someone pulls the latest code from Git, something breaks. Sound familiar? That&#8217;s exactly what environment variables fix. And once you understand how they work ... <a title="SPFx Environment Variables: A Practical Guide for Every Scenario" class="read-more" href="https://www.spguides.com/spfx-environment-variables/" aria-label="Read more about SPFx Environment Variables: A Practical Guide for Every Scenario">read more...</a>]]></description>
										<content:encoded><![CDATA[
<p>If you&#8217;ve ever worked on an<a href="https://www.spguides.com/spfx-training-course/"> SPFx project</a> with a team, you&#8217;ve probably hit this problem: your&nbsp;<code>serve.json</code>&nbsp;has your personal SharePoint URL hardcoded, your colleague has a different tenant, and every time someone pulls the latest code from Git, something breaks. Sound familiar?</p>



<p>That&#8217;s exactly what environment variables fix. And once you understand how they work in SPFx, you&#8217;ll wonder how you ever managed without them.</p>



<p>Let me walk you through everything, from the simplest one-liner fix to more advanced patterns for build-time config injection, so you can pick the approach that fits your project.</p>



<p>Let me explain how to use <strong>SharePoint Framework (SPFx) environment variables</strong>.</p>



<h2 class="wp-block-heading" id="what-are-spfx-environment-variables-really">What Are SPFx Environment Variables, Really?</h2>



<p>Think of environment variables as settings that live&nbsp;<em>outside</em>&nbsp;your code. Instead of hardcoding&nbsp;<code>https://mytenant.sharepoint.com</code>&nbsp;directly in a config file or <a href="https://www.spguides.com/typescript-import-json-file/">TypeScript file</a>, you store it in your operating system (or a&nbsp;<code>.env</code>&nbsp;file), and your project just reads it from there.</p>



<p>This is incredibly useful when:</p>



<ul class="wp-block-list">
<li>You work in a team where everyone has a different SharePoint tenant URL</li>



<li>You deploy to multiple environments — dev, staging, production</li>



<li>You don&#8217;t want API keys or secrets accidentally committed to your Git repo</li>



<li>You want your CI/CD pipeline to inject the right values at build time</li>
</ul>



<p>If you want to learn SPFx development, check out our <a href="https://www.spguides.com/spfx-training-course/" target="_blank" rel="noreferrer noopener">SPFx training course</a>.</p>



<h2 class="wp-block-heading">Method 1: The <strong>SPFX_SERVE_TENANT_DOMAIN</strong> Built-In Variable</h2>



<p>This is the easiest method and requires zero npm packages. Microsoft built it directly into the SPFx toolchain.</p>



<p>Here&#8217;s how it works: when you run gulp serve or heft start, the build system looks for an OS environment variable called <code>SPFX_SERVE_TENANT_DOMAIN</code> and swaps out the <code>{tenantDomain}</code> placeholder in your <code>serve.json</code> automatically.</p>



<p><strong>Step 1 — Update your&nbsp;<code>serve.json</code></strong></p>



<p>Open&nbsp;<code>config/serve.json</code>&nbsp;and use the placeholder instead of a hardcoded URL:</p>



<pre class="wp-block-preformatted">{<br>  "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/serve.schema.json",<br>  "port": 4321,<br>  "https": true,<br>  "initialPage": "https://{tenantDomain}/sites/mysite/_layouts/workbench.aspx"<br>}</pre>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="e3e3e7" data-has-transparency="false" style="--dominant-color: #e3e3e7;" fetchpriority="high" decoding="async" width="1024" height="236" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/environment-variables-in-spfx-1024x236.avif" alt="environment variables in spfx" class="wp-image-134253 not-transparent" title="environment variables in spfx" srcset="https://www.spguides.com/wp-content/uploads/2026/04/environment-variables-in-spfx-1024x236.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/environment-variables-in-spfx-300x69.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/environment-variables-in-spfx-768x177.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/environment-variables-in-spfx.avif 1334w" /></figure></div>


<p>Notice&nbsp;<code>{tenantDomain}</code>&nbsp;— The toolchain will replace this at runtime with the value of your OS environment variable.</p>



<p><strong>Step 2 — Set the environment variable</strong></p>



<p>On&nbsp;<strong>Windows (PowerShell)</strong>&nbsp;— temporary for this session only:</p>



<pre class="wp-block-preformatted">$env:SPFX_SERVE_TENANT_DOMAIN = "contoso.sharepoint.com"</pre>



<p>To make it permanent (so you don&#8217;t have to set it every time):</p>



<pre class="wp-block-preformatted">[System.Environment]::SetEnvironmentVariable("SPFX_SERVE_TENANT_DOMAIN", "contoso.sharepoint.com", "User")</pre>



<p>Here, update <span style="box-sizing: border-box; margin: 0px; padding: 0px;"><strong>&#8216;con</strong></span><strong>toso</strong>&#8216; with your tenant domain name.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="1d1b1c" data-has-transparency="false" style="--dominant-color: #1d1b1c;" decoding="async" width="1024" height="180" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/Environment-Variables-with-SPFx-1024x180.avif" alt="Environment Variables with SPFx" class="wp-image-134255 not-transparent" title="Environment Variables with SPFx" srcset="https://www.spguides.com/wp-content/uploads/2026/04/Environment-Variables-with-SPFx-1024x180.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/Environment-Variables-with-SPFx-300x53.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/Environment-Variables-with-SPFx-768x135.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/Environment-Variables-with-SPFx.avif 1476w" /></figure></div>


<p>After some time, reopen your <a href="https://www.spguides.com/spfx-property-pane-slide-manager-drag-drop/">SPFx web part </a>Terminal pane, and check whether the variable contains a value or not with this command <code>echo $env:SPFX_SERVE_TENANT_DOMAIN</code></p>



<p>On&nbsp;<strong>macOS / Linux</strong>:</p>



<pre class="wp-block-preformatted">export SPFX_SERVE_TENANT_DOMAIN="contoso.sharepoint.com"</pre>



<p>To persist it, add that line to your&nbsp;<code>~/.bashrc</code>&nbsp;or&nbsp;<code>~/.zshrc</code>.</p>



<p><strong>Step 3 — Run&nbsp;<code>gulp serve</code>&nbsp;as usual</strong></p>



<p>That&#8217;s it. The build toolchain replaces&nbsp;<code>{tenantDomain}</code>&nbsp;on the fly before opening the browser. No code changes, no config file edits per developer. </p>



<blockquote class="wp-block-quote has-base-background-color has-background is-layout-flow wp-block-quote-is-layout-flow">
<p><strong>NOTE: </strong>If you are using SPFx solutions with gulp packages, then run the <code>gulp serve </code>command to test. In case you are on <code>SPFx version 1.22.*,</code> with the Heft-based tool chain, run the <code>Heft start</code> command.</p>
</blockquote>



<p>In the image below, you can see that the <strong>initialPage </strong>URL in <strong>serve.json</strong> has a placeholder called <strong>{tenantDomain}</strong>. Now, instead of hardcoding our SharePoint tenant domain directly in this URL, we created an environment variable called <strong>SPFX_SERVE_TENANT_DOMAIN</strong> and stored our tenant domain value in it. </p>



<p>So now when we run the heft start command, SPFx is smart enough to automatically read that environment variable and replace the {tenantDomain} placeholder with our actual tenant domain in the URL.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="647795" data-has-transparency="false" style="--dominant-color: #647795;" decoding="async" width="1024" height="482" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/using-environment-variables-in-sharepoint-framework-1024x482.avif" alt="using environment variables in sharepoint framework" class="wp-image-134258 not-transparent" title="using environment variables in sharepoint framework" srcset="https://www.spguides.com/wp-content/uploads/2026/04/using-environment-variables-in-sharepoint-framework-1024x482.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/using-environment-variables-in-sharepoint-framework-300x141.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/using-environment-variables-in-sharepoint-framework-768x361.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/using-environment-variables-in-sharepoint-framework-1536x723.avif 1536w, https://www.spguides.com/wp-content/uploads/2026/04/using-environment-variables-in-sharepoint-framework.avif 1560w" /></figure></div>


<p><strong>Why I like this method:</strong>&nbsp;It&#8217;s the simplest possible solution for the most common pain point. It works out of the box with every SPFx version and requires no extra packages. The downside is it only handles the tenant domain/URL for&nbsp;<code>serve.json</code>&nbsp;— it doesn&#8217;t help with injecting variables into your TypeScript code.</p>



<h2 class="wp-block-heading" id="method-2-os-environment-variables-in-powershell-qu">Method 2: OS Environment Variables in PowerShell (Quick and Practical)</h2>



<p>Sometimes you just need to pass a value temporarily before running a command. <a href="https://www.spguides.com/install-pnp-powershell/">PowerShell </a>makes this very easy.</p>



<p><strong>Temporary (session only):</strong></p>



<pre class="wp-block-preformatted">$env:SPFX_API_KEY = "my-api-key-12345"<br>gulp serve</pre>



<p>This variable exists only until you close the terminal window.</p>



<p><strong>Permanent (User scope):</strong></p>



<pre class="wp-block-preformatted">[System.Environment]::SetEnvironmentVariable("SPFX_API_KEY", "my-api-key-12345", "User")</pre>



<p><strong>Permanent (Machine scope — needs admin):</strong></p>



<pre class="wp-block-preformatted">[System.Environment]::SetEnvironmentVariable("SPFX_API_KEY", "my-api-key-12345", "Machine")</pre>



<p><strong>Check if it&#8217;s set:</strong></p>



<pre class="wp-block-preformatted">$env:SPFX_API_KEY</pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="506685" data-has-transparency="false" style="--dominant-color: #506685;" loading="lazy" decoding="async" width="766" height="164" sizes="(max-width: 766px) 100vw, 766px" src="https://www.spguides.com/wp-content/uploads/2026/04/using-environment-variables-in-sharepoint-framework-for-current-session.avif" alt="using environment variables in sharepoint framework for current session" class="wp-image-134262 not-transparent" title="using environment variables in sharepoint framework for current session" srcset="https://www.spguides.com/wp-content/uploads/2026/04/using-environment-variables-in-sharepoint-framework-for-current-session.avif 766w, https://www.spguides.com/wp-content/uploads/2026/04/using-environment-variables-in-sharepoint-framework-for-current-session-300x64.avif 300w" /></figure></div>


<p><strong>Remove it:</strong></p>



<pre class="wp-block-preformatted"><em># From session only</em><br>Remove-Item Env:\SPFX_API_KEY<br><br><em># Permanently (User scope)</em><br>[System.Environment]::SetEnvironmentVariable("SPFX_API_KEY", $null, "User")</pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="395377" data-has-transparency="false" style="--dominant-color: #395377;" loading="lazy" decoding="async" width="812" height="244" sizes="(max-width: 812px) 100vw, 812px" src="https://www.spguides.com/wp-content/uploads/2026/04/remove-environment-variables-in-spfx-for-current-session.avif" alt="remove environment variables in spfx for current session" class="wp-image-134263 not-transparent" title="remove environment variables in spfx for current session" srcset="https://www.spguides.com/wp-content/uploads/2026/04/remove-environment-variables-in-spfx-for-current-session.avif 812w, https://www.spguides.com/wp-content/uploads/2026/04/remove-environment-variables-in-spfx-for-current-session-300x90.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/remove-environment-variables-in-spfx-for-current-session-768x231.avif 768w" /></figure></div>


<p>In the image above, you can see I removed the current session variable. When I check back, does it still contain a value? It shows empty.</p>



<p>This method is great for quick local testing. But if you&#8217;re working in a team, it gets tedious; every developer has to remember to set all the right variables manually. That&#8217;s where&nbsp;<code>.env</code>&nbsp;files come in.</p>



<h2 class="wp-block-heading">Method 3: Using .env Files with <code>dotenv</code> (Recommended for Teams)</h2>



<p>This is my favorite approach for team projects with the&nbsp;<strong>gulp-based toolchain</strong>&nbsp;(SPFx versions before 1.22). You define all your variables in a&nbsp;<code>.env</code>&nbsp;file, exclude them from version control, and dynamically inject them into Webpack during the build process.</p>



<p><strong>Step 1 — &nbsp;Install Required Packages</strong></p>



<p>Install dotenv to read the files, and cross-env to easily switch environments across Windows, Mac, and CI/CD pipelines.</p>



<pre class="wp-block-preformatted">npm install dotenv cross-env --save-dev</pre>



<p><strong>Step 2 — Create your Environment Files</strong></p>



<p>Create a folder named <strong>env </strong>at the root of your project, and create a file named <strong>dev.env</strong> (for local development) and prod.env (for production).</p>



<pre class="wp-block-preformatted"># env/dev.env<br>SPFX_API_BASE_URL=https://dev-api.contoso.com<br>SPFX_APP_INSIGHTS_KEY=dev-abc123-xyz<br>SPFX_ENVIRONMENT=development</pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f1eeee" data-has-transparency="false" style="--dominant-color: #f1eeee;" loading="lazy" decoding="async" width="836" height="238" sizes="(max-width: 836px) 100vw, 836px" src="https://www.spguides.com/wp-content/uploads/2026/04/setup-environment-variables-in-spfx-web-part.avif" alt="setup environment variables in spfx web part" class="wp-image-134287 not-transparent" title="setup environment variables in spfx web part" srcset="https://www.spguides.com/wp-content/uploads/2026/04/setup-environment-variables-in-spfx-web-part.avif 836w, https://www.spguides.com/wp-content/uploads/2026/04/setup-environment-variables-in-spfx-web-part-300x85.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/setup-environment-variables-in-spfx-web-part-768x219.avif 768w" /></figure></div>


<p><strong>Step 3 — Add environment files to .gitignore</strong></p>



<p>This is critical. You never want to commit API keys or production secrets to your repository.</p>



<pre class="wp-block-preformatted"># .gitignore<br>env/*.env<br>!env/sample.env</pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f2f2f2" data-has-transparency="false" style="--dominant-color: #f2f2f2;" loading="lazy" decoding="async" width="680" height="454" sizes="(max-width: 680px) 100vw, 680px" src="https://www.spguides.com/wp-content/uploads/2026/04/spfx-development-environment-variables-setup.avif" alt="spfx development environment variables setup" class="wp-image-134288 not-transparent" title="spfx development environment variables setup" srcset="https://www.spguides.com/wp-content/uploads/2026/04/spfx-development-environment-variables-setup.avif 680w, https://www.spguides.com/wp-content/uploads/2026/04/spfx-development-environment-variables-setup-300x200.avif 300w" /></figure></div>


<p>(Tip: It is good practice to commit a sample.env with dummy values so new developers know what variables they need to configure).</p>



<p><strong>Step 4 — Update gulpfile.js for Dynamic Injection</strong></p>



<p>Instead of hardcoding every variable, we can configure Webpack to automatically find and inject any variable that starts with SPFX_. Replace your gulpfile.js with this:</p>



<pre class="wp-block-preformatted">'use strict';<br><br>const gulp = require('gulp');<br>const build = require('@microsoft/sp-build-web');<br>const webpack = require('webpack');<br>const dotenv = require('dotenv');<br>const fs = require('fs');<br>const path = require('path');<br><br>// 1. Determine the environment (default to 'dev')<br>const environment = process.env.NODE_ENV || 'dev';<br>const envPath = path.resolve(__dirname, `./env/${environment}.env`);<br><br>// 2. Load the file if it exists<br>let envConfig = {};<br>if (fs.existsSync(envPath)) {<br>  envConfig = dotenv.config({ path: envPath }).parsed || {};<br>} else {<br>  console.warn(`[!] Warning: ${envPath} not found. Proceeding without env injection.`);<br>}<br><br>// 3. Merge into Webpack configuration<br>build.configureWebpack.mergeConfig({<br>  additionalConfiguration: (generatedConfig) =&gt; {<br>    const definitions = {};<br><br>    Object.keys(envConfig).forEach((key) =&gt; {<br>      if (key.startsWith('SPFX_')) {<br>        definitions[`process.env.${key}`] = JSON.stringify(envConfig[key]);<br>      }<br>    });<br><br>    generatedConfig.plugins.push(new webpack.DefinePlugin(definitions));<br>    return generatedConfig;<br>  }<br>});<br><br>// 4. Force task registration (Fixes "Task never defined" error)<br>let getTasks = build.rig.getTasks;<br>build.rig.getTasks = function () {<br>  let result = getTasks.call(build.rig);<br>  // Ensure serve is properly mapped<br>  result.set('serve', result.get('serve-deprecated') || result.get('serve'));<br>  return result;<br>};<br><br>// 5. Initialize build<br>build.initialize(gulp);<br></pre>



<p><strong>Step 5 — Add TypeScript Typings (Crucial for SPFx)</strong></p>



<p>To prevent <a href="https://www.spguides.com/get-key-by-value-from-enum-string-in-typescript/">TypeScript </a>from complaining that process.env is undefined, create or update a <strong>global.d.ts</strong> file inside your <strong>src </strong>folder:</p>



<pre class="wp-block-preformatted">// src/global.d.ts<br>declare interface NodeJS {<br>  env: {<br>    NODE_ENV: 'dev' | 'prod';<br>    SPFX_API_BASE_URL: string;<br>    SPFX_APP_INSIGHTS_KEY: string;<br>    SPFX_ENVIRONMENT: string;<br>    [key: string]: string | undefined;<br>  };<br>}<br>declare var process: NodeJS;</pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f1f0f0" data-has-transparency="false" style="--dominant-color: #f1f0f0;" loading="lazy" decoding="async" width="796" height="400" sizes="(max-width: 796px) 100vw, 796px" src="https://www.spguides.com/wp-content/uploads/2026/04/spfx-environment-variables-setup-in-gulp-tool-chain.avif" alt="spfx environment variables setup in gulp tool chain" class="wp-image-134289 not-transparent" title="spfx environment variables setup in gulp tool chain" srcset="https://www.spguides.com/wp-content/uploads/2026/04/spfx-environment-variables-setup-in-gulp-tool-chain.avif 796w, https://www.spguides.com/wp-content/uploads/2026/04/spfx-environment-variables-setup-in-gulp-tool-chain-300x151.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/spfx-environment-variables-setup-in-gulp-tool-chain-768x386.avif 768w" /></figure></div>


<p><strong>Step 6 — Use Variables in your TypeScript/React Code</strong></p>



<p>Because of the typings in Step 5, you no longer need&nbsp;<code>as string</code>. You get full IntelliSense autocomplete natively in<a href="https://www.spguides.com/run-powershell-script-in-visual-studio-code/"> VS Code</a>.</p>



<pre class="wp-block-preformatted">import * as React from 'react';<br>import styles from './Listitems.module.scss';<br>import type { IListitemsProps } from './IListitemsProps';<br>import { escape } from '@microsoft/sp-lodash-subset';<br><br>export default class Listitems extends React.Component&lt;IListitemsProps&gt; {<br>  public render(): React.ReactElement&lt;IListitemsProps&gt; {<br>    const {<br>      description,<br>      isDarkTheme,<br>      environmentMessage,<br>      hasTeamsContext,<br>      userDisplayName<br>    } = this.props;<br><br>    return (<br>      &lt;section className={`${styles.listitems} ${hasTeamsContext ? styles.teams : ''}`}&gt;<br>        &lt;div className={styles.welcome}&gt;<br>          &lt;img alt="" src={isDarkTheme ? require('../assets/welcome-dark.png') : require('../assets/welcome-light.png')} className={styles.welcomeImage} /&gt;<br>          &lt;h2&gt;Well done, {escape(userDisplayName)}!&lt;/h2&gt;<br>          &lt;div&gt;{environmentMessage}&lt;/div&gt;<br>          &lt;div&gt;Web part property value: &lt;strong&gt;{escape(description)}&lt;/strong&gt;&lt;/div&gt;<br>        &lt;/div&gt;<br><br>        {/* --- CUSTOM ENVIRONMENT VARIABLES BLOCK --- */}<br>        &lt;div style={{ backgroundColor: '#e1dfdd', padding: '15px', margin: '20px 0', borderRadius: '4px', color: '#323130' }}&gt;<br>          &lt;h3 style={{ marginTop: 0 }}&gt;Environment Variables Test&lt;/h3&gt;<br>          &lt;p style={{ margin: '5px 0' }}&gt;&lt;strong&gt;Environment:&lt;/strong&gt; {process.env.SPFX_ENVIRONMENT}&lt;/p&gt;<br>          &lt;p style={{ margin: '5px 0' }}&gt;&lt;strong&gt;API Base URL:&lt;/strong&gt; {process.env.SPFX_API_BASE_URL}&lt;/p&gt;<br>          &lt;p style={{ margin: '5px 0' }}&gt;&lt;strong&gt;App Insights Key:&lt;/strong&gt; {process.env.SPFX_APP_INSIGHTS_KEY}&lt;/p&gt;<br>        &lt;/div&gt;<br>        {/* ---------------------------------------- */}<br>      &lt;/section&gt;<br>    );<br>  }<br>}</pre>



<p><strong>Step 7 — Running and Building for Different Environments<br></strong>Now, you can easily switch between environments using&nbsp;<code>cross-env</code>. You can add these commands directly to the&nbsp;<code>"scripts"</code>&nbsp;section of your&nbsp;<code>package.json</code>:</p>



<pre class="wp-block-code"><code>"scripts": {
  "serve": "cross-env NODE_ENV=dev gulp serve",
  "build:prod": "cross-env NODE_ENV=prod gulp bundle --ship &amp;&amp; gulp package-solution --ship"
}</code></pre>



<p>Then run the gulp serve command. In the <a href="https://www.spguides.com/retrieve-sharepoint-list-items-using-sharepoint-framework/">SPFx web part</a>, you&#8217;ll see the environment variables we defined:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f0f0ee" data-has-transparency="false" style="--dominant-color: #f0f0ee;" loading="lazy" decoding="async" width="1016" height="686" sizes="(max-width: 1016px) 100vw, 1016px" src="https://www.spguides.com/wp-content/uploads/2026/04/configure-environment-variables-for-spfx-with-gulp-package-tool-chain.avif" alt="configure environment variables for spfx with gulp package tool chain" class="wp-image-134282 not-transparent" title="configure environment variables for spfx with gulp package tool chain" srcset="https://www.spguides.com/wp-content/uploads/2026/04/configure-environment-variables-for-spfx-with-gulp-package-tool-chain.avif 1016w, https://www.spguides.com/wp-content/uploads/2026/04/configure-environment-variables-for-spfx-with-gulp-package-tool-chain-300x203.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/configure-environment-variables-for-spfx-with-gulp-package-tool-chain-768x519.avif 768w" /></figure></div>


<h2 class="wp-block-heading" id="method-4-webpack-defineplugin--injecting-variables">Method 4: Webpack DefinePlugin — Injecting Variables at Build Time</h2>



<p>The Webpack DefinePlugin is the engine behind method 3. Sometimes it&#8217;s useful to understand it directly, especially for CI/CD pipelines where you want the pipeline itself to inject values.</p>



<p>Here&#8217;s a standalone example:</p>



<pre class="wp-block-preformatted"><em>// gulpfile.js</em><br>build.configureWebpack.mergeConfig({<br>  additionalConfiguration: (generatedConfig) =&gt; {<br>    const isDebugMode = generatedConfig.plugins<br>      .find(p =&gt; p instanceof webpack.DefinePlugin)<br>      ?.definitions?.DEBUG;<br><br>    generatedConfig.plugins.find(p =&gt; p instanceof webpack.DefinePlugin)<br>      .definitions['process.env.API_ENDPOINT'] = isDebugMode<br>        ? JSON.stringify('https://dev-api.contoso.com')<br>        : JSON.stringify(process.env.API_ENDPOINT);<br><br>    return generatedConfig;<br>  }<br>});</pre>



<p>In this case, during&nbsp;<code>gulp serve</code>&nbsp;(debug mode), it uses the dev URL. During&nbsp;<code>gulp bundle --ship</code>&nbsp;(production), it reads from the OS environment variable&nbsp;<code>API_ENDPOINT</code>&nbsp;— which in a DevOps pipeline you&#8217;d set as a secret pipeline variable.</p>



<p>This is perfect for things like:</p>



<ul class="wp-block-list">
<li>Azure Application Insights instrumentation keys</li>



<li>Backend API endpoints</li>



<li>Feature flags</li>
</ul>



<h2 class="wp-block-heading" id="method-5-spfx-122-with-heft-new-build-system">Method 5: SPFx 1.22+ with Heft (New Build System)</h2>



<p>If you&#8217;re <a href="https://www.spguides.com/set-up-spfx-project-with-heft/" target="_blank" rel="noreferrer noopener">starting a fresh project with SPFx 1.22</a> or later, you&#8217;ll notice that <code>gulp</code> has been replaced by <strong>Heft</strong> as the default build system. Heft is a config-driven task orchestrator from Rush Stack that Microsoft now recommends for all new projects.</p>



<p>With Heft, you can&#8217;t use&nbsp;<code>gulpfile.js</code>&nbsp;the same way. Here are the main approaches.</p>



<h2 class="wp-block-heading" id="the-recommended-approach-webpack-patch-plugin">The Recommended Approach: Webpack Patch Plugin</h2>



<p>Microsoft&#8217;s official way to customize WebPack in Heft projects is through a&nbsp;<code>webpack-patch.json</code>&nbsp;config file.</p>



<p><strong>Step 1: Create the JSON Configuration File</strong></p>



<p>In your project&#8217;s <strong>config </strong>folder, create a new file named <strong>webpack-patch.json</strong> and add the following content:</p>



<pre class="wp-block-preformatted">{<br>  "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/webpack-patch.schema.json",<br>  "patchFiles": ["./config/webpack-patch/env-inject.js"]<br>}</pre>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f3f2f3" data-has-transparency="false" style="--dominant-color: #f3f2f3;" loading="lazy" decoding="async" width="1024" height="313" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/Environment-variables-in-a-React-SharePoint-Webpart-1024x313.avif" alt="Environment variables in a React SharePoint Webpart" class="wp-image-134271 not-transparent" title="Environment variables in a React SharePoint Webpart" srcset="https://www.spguides.com/wp-content/uploads/2026/04/Environment-variables-in-a-React-SharePoint-Webpart-1024x313.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/Environment-variables-in-a-React-SharePoint-Webpart-300x92.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/Environment-variables-in-a-React-SharePoint-Webpart-768x234.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/Environment-variables-in-a-React-SharePoint-Webpart.avif 1304w" /></figure></div>


<p><strong>Step 2: Create the JavaScript Patch File</strong></p>



<p>You need to create a new folder inside the <strong>config </strong>folder to hold your script.</p>



<ul class="wp-block-list">
<li>Create a folder named webpack-patch inside the config folder.</li>



<li>Inside that new folder, create a file named <strong>env-inject.js</strong> and add this code:</li>
</ul>



<pre class="wp-block-preformatted">const dotenv = require('dotenv');<br>const fs = require('fs');<br>const path = require('path');<br><br>// Resolve webpack from your project root — no rig path guessing needed<br>const webpackPath = require.resolve('webpack', { paths: [path.resolve(__dirname, '../../')] });<br>const webpack = require(webpackPath);<br><br>module.exports = function(webpackConfig) {<br>  const NODE_ENV = process.env.NODE_ENV || 'dev';<br>  const envPath = path.resolve(__dirname, `../../env/${NODE_ENV}.env`);<br><br>  if (!fs.existsSync(envPath)) {<br>    console.warn(`Warning: ${envPath} not found. Skipping env injection.`);<br>    return webpackConfig;<br>  }<br><br>  const envConfig = dotenv.parse(fs.readFileSync(envPath));<br>  const definitions = {};<br><br>  Object.entries(envConfig)<br>    .filter(([key]) =&gt; key.startsWith('SPFX_'))<br>    .forEach(([key, value]) =&gt; {<br>      definitions[`process.env.${key}`] = JSON.stringify(value);<br>    });<br><br>  webpackConfig.plugins.push(new webpack.DefinePlugin(definitions));<br>  return webpackConfig;<br>};</pre>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f4f4f5" data-has-transparency="false" style="--dominant-color: #f4f4f5;" loading="lazy" decoding="async" width="1024" height="606" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/spfx-environment-variables-setup-step-by-step-1024x606.avif" alt="spfx environment variables setup step by step" class="wp-image-134272 not-transparent" title="spfx environment variables setup step by step" srcset="https://www.spguides.com/wp-content/uploads/2026/04/spfx-environment-variables-setup-step-by-step-1024x606.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/spfx-environment-variables-setup-step-by-step-300x177.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/spfx-environment-variables-setup-step-by-step-768x454.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/spfx-environment-variables-setup-step-by-step.avif 1278w" /></figure></div>


<p><strong>Step 3: Install Dependencies and Create Environment Files</strong></p>



<p>Your patch file uses dotenv to parse environment files, so you need to install it.</p>



<ul class="wp-block-list">
<li>Open your terminal and run:</li>
</ul>



<pre class="wp-block-code"><code>npm install dotenv --save-dev</code></pre>



<ul class="wp-block-list">
<li>In the root of your project (the same level as&nbsp;<code>src</code>&nbsp;and&nbsp;<code>config</code>), create a folder named&nbsp;<code>env</code>.</li>



<li>Inside the&nbsp;<strong><code>env</code>&nbsp;</strong>folder, create a file named&nbsp;<strong><code>dev.env</code>&nbsp;</strong>and define your variables. They&nbsp;<strong>must</strong>&nbsp;start with&nbsp;<code>SPFX_</code>:</li>
</ul>



<pre class="wp-block-code"><code>SPFX_API_BASE_URL=https://my-dev-api.azurewebsites.net
SPFX_GREETING_MESSAGE=Hello from Dev Environment</code></pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f4f3f3" data-has-transparency="false" style="--dominant-color: #f4f3f3;" loading="lazy" decoding="async" width="912" height="236" sizes="(max-width: 912px) 100vw, 912px" src="https://www.spguides.com/wp-content/uploads/2026/04/environment-variables-setup-in-windows-10-for-spfx.avif" alt="environment variables setup in windows 10 for spfx" class="wp-image-134275 not-transparent" title="environment variables setup in windows 10 for" srcset="https://www.spguides.com/wp-content/uploads/2026/04/environment-variables-setup-in-windows-10-for-spfx.avif 912w, https://www.spguides.com/wp-content/uploads/2026/04/environment-variables-setup-in-windows-10-for-spfx-300x78.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/environment-variables-setup-in-windows-10-for-spfx-768x199.avif 768w" /></figure></div>


<p><strong>Step 4: Add TypeScript Typings (Crucial for SPFx)<br></strong>By default, TypeScript will throw an error if you try to type process.env.SPFX_API_BASE_URL because it doesn&#8217;t know what process.env is. You need to define these types so your SPFx web part compiles successfully.</p>



<ul class="wp-block-list">
<li>In your&nbsp;<code>src</code>&nbsp;folder, create a file named&nbsp;<code><strong>global.d.ts</strong></code>&nbsp;(or open it if it already exists).</li>



<li>Add the following TypeScript declaration to let the compiler know about your custom variables:</li>
</ul>



<pre class="wp-block-code"><code>declare interface NodeJS {
  env: {
    NODE_ENV: 'dev' | 'production';
    SPFX_API_BASE_URL: string;
    SPFX_GREETING_MESSAGE: string;
    &#91;key: string]: string | undefined;
  };
}
declare var process: NodeJS;</code></pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f2f0f1" data-has-transparency="false" style="--dominant-color: #f2f0f1;" loading="lazy" decoding="async" width="738" height="440" sizes="(max-width: 738px) 100vw, 738px" src="https://www.spguides.com/wp-content/uploads/2026/04/Configuring-Environment-Variables-for-SPFx-Development.avif" alt="Configuring Environment Variables for SPFx Development" class="wp-image-134276 not-transparent" title="Configuring Environment Variables for SPFx Development" srcset="https://www.spguides.com/wp-content/uploads/2026/04/Configuring-Environment-Variables-for-SPFx-Development.avif 738w, https://www.spguides.com/wp-content/uploads/2026/04/Configuring-Environment-Variables-for-SPFx-Development-300x179.avif 300w" /></figure></div>


<p><strong>Step 5: How to Test and Use It</strong></p>



<p>Now you can safely use your environment variables anywhere inside your web part component (e.g., inside src/webparts/yourWebPart/components/YourWebPart.tsx).</p>



<ul class="wp-block-list">
<li>Open your main <a href="https://www.spguides.com/bind-sharepoint-list-items-to-spfx-fluent-ui-react-dropdown/">React component</a> or web part TypeScript file.</li>



<li>Add a simple HTML tags to render it on the screen:</li>
</ul>



<pre class="wp-block-code"><code>public render(): React.ReactElement&lt;IHeftProjectProps&gt; {
    const {
      description,
      isDarkTheme,
      environmentMessage,
      hasTeamsContext,
      userDisplayName
    } = this.props;

    return (
      &lt;section className={`${styles.heftProject} ${hasTeamsContext ? styles.teams : ''}`}&gt;
        &lt;div className={styles.welcome}&gt;
          &lt;img alt="" src={isDarkTheme ? require('../assets/welcome-dark.png') : require('../assets/welcome-light.png')} className={styles.welcomeImage} /&gt;
          &lt;h2&gt;Well done, {escape(userDisplayName)}!&lt;/h2&gt;
          &lt;div&gt;{environmentMessage}&lt;/div&gt;
          &lt;div&gt;Web part property value: &lt;strong&gt;{escape(description)}&lt;/strong&gt;&lt;/div&gt;
        &lt;/div&gt;
        
        {/* --- CUSTOM ENVIRONMENT VARIABLES BLOCK --- */}
        &lt;div style={{ backgroundColor: '#f4f4f4', padding: '15px', marginTop: '20px', borderRadius: '4px' }}&gt;
          &lt;h3&gt;Environment Variables Test&lt;/h3&gt;
          &lt;p&gt;&lt;strong&gt;Greeting:&lt;/strong&gt; {process.env.SPFX_GREETING_MESSAGE}&lt;/p&gt;
          &lt;p&gt;&lt;strong&gt;API Base URL:&lt;/strong&gt; {process.env.SPFX_API_BASE_URL}&lt;/p&gt;
        &lt;/div&gt;
        {/* ---------------------------------------- */}

      &lt;/section&gt;
    );
  }</code></pre>



<p>To test the <strong>dev.env</strong> variables, simply run your standard Heft command. Because the script defaults to dev, it will automatically pick up <strong>dev.env</strong></p>



<pre class="wp-block-code"><code>heft start</code></pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f3f4f2" data-has-transparency="false" style="--dominant-color: #f3f4f2;" loading="lazy" decoding="async" width="1004" height="676" sizes="(max-width: 1004px) 100vw, 1004px" src="https://www.spguides.com/wp-content/uploads/2026/04/access-environment-variables-within-spfx-web-part.avif" alt="access environment variables within spfx web part" class="wp-image-134269 not-transparent" title="access environment variables within spfx web part" srcset="https://www.spguides.com/wp-content/uploads/2026/04/access-environment-variables-within-spfx-web-part.avif 1004w, https://www.spguides.com/wp-content/uploads/2026/04/access-environment-variables-within-spfx-web-part-300x202.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/access-environment-variables-within-spfx-web-part-768x517.avif 768w" /></figure></div>


<p><strong>Note:</strong> If you want to test a production environment (e.g., prod.env), you would run cross-env NODE_ENV=prod npm run build (assuming you have cross-env installed and configured in your package.json scripts)</p>



<h2 class="wp-block-heading" id="alternative-pre-build-typescript-generation-type-s">Alternative: Pre-Build TypeScript Generation (Type-Safe)</h2>



<p>If you want full TypeScript type safety and IDE autocomplete on your environment variables, this is the cleanest approach.</p>



<p><strong>Create&nbsp;<code>scripts/generate-env-config.js</code>:</strong></p>



<pre class="wp-block-preformatted">const fs = require('fs');<br>const dotenv = require('dotenv');<br><br>const NODE_ENV = process.env.NODE_ENV || 'dev';<br>const envConfig = dotenv.parse(fs.readFileSync(`./env/${NODE_ENV}.env`));<br><br>const spfxVars = Object.entries(envConfig)<br>  .filter(([key]) =&gt; key.startsWith('SPFX_'))<br>  .map(([key, value]) =&gt; `  ${key}: '${value}'`)<br>  .join(',\n');<br><br>const output = `// AUTO-GENERATED — Do not edit manually<br>export const ENV_CONFIG = {<br>${spfxVars}<br>} as const;<br>`;<br><br>fs.writeFileSync('src/utils/envConfig.generated.ts', output);<br>console.log('Environment config generated successfully.');</pre>



<p><strong>Update&nbsp;<code>package.json</code>&nbsp;scripts:</strong></p>



<pre class="wp-block-preformatted">"scripts": {<br>  "generate-env": "node scripts/generate-env-config.js",<br>  "start:dev": "cross-env NODE_ENV=dev npm run generate-env &amp;&amp; heft start",<br>  "start:prod": "cross-env NODE_ENV=prod npm run generate-env &amp;&amp; heft start"<br>}</pre>



<p><strong>Use it in your components:</strong></p>



<pre class="wp-block-preformatted">import { ENV_CONFIG } from '../utils/envConfig.generated';<br><br><em>// Full autocomplete and type checking!</em><br>const apiUrl = ENV_CONFIG.SPFX_API_BASE_URL;<br>const timeout = ENV_CONFIG.SPFX_API_TIMEOUT;</pre>



<p>The generated file is committed to&nbsp;<code>.gitignore</code>&nbsp;and rebuilt every time you run the start script.</p>



<h2 class="wp-block-heading" id="choosing-the-right-method">Choosing the Right Method</h2>



<p>Here&#8217;s a quick summary of when to use what:</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Scenario</th><th>Best Method</th></tr></thead><tbody><tr><td>Just need the right tenant URL for&nbsp;<code>gulp serve</code></td><td><code>SPFX_SERVE_TENANT_DOMAIN</code>&nbsp;OS variable</td></tr><tr><td>Quick local testing, no team coordination needed</td><td>PowerShell&nbsp;<code>$env:</code>&nbsp;temporary variable</td></tr><tr><td>Team project on gulp-based SPFx (before v1.22)</td><td><code>.env</code>&nbsp;files +&nbsp;<code>dotenv</code>&nbsp;+ DefinePlugin in&nbsp;<code>gulpfile.js</code></td></tr><tr><td>CI/CD pipeline injecting secrets</td><td>OS env variables + DefinePlugin in&nbsp;<code>gulpfile.js</code>&nbsp;or webpack-patch</td></tr><tr><td>New project on SPFx 1.22+ with Heft</td><td>Webpack Patch method (<code>webpack-patch.json</code>)</td></tr><tr><td>Need type safety and autocomplete</td><td>Pre-Build TypeScript generation script</td></tr></tbody></table></figure>



<h2 class="wp-block-heading" id="common-mistakes-to-avoid">Common Mistakes to Avoid</h2>



<ul class="wp-block-list">
<li><strong>Committing&nbsp;<code>.env</code>&nbsp;files to Git.</strong>&nbsp;Always add&nbsp;<code>.env</code>,&nbsp;<code>*.env</code>, and&nbsp;<code>env/</code>&nbsp;to&nbsp;<code>.gitignore</code>.</li>



<li><strong>Forgetting the&nbsp;<code>SPFX_</code>&nbsp;prefix.</strong>&nbsp;Variables without this prefix often end up as&nbsp;<code>undefined</code>&nbsp;at runtime.</li>



<li><strong>Using&nbsp;<code>require('webpack')</code>&nbsp;in Heft projects.</strong>&nbsp;This causes silent build failures. Use the SPFx rig import instead.</li>



<li><strong>Not providing fallback values.</strong>&nbsp;Always use&nbsp;<code>process.env.MY_VAR || 'fallback'</code>&nbsp;so your build doesn&#8217;t break in environments where the variable isn&#8217;t set.</li>



<li><strong>Expecting runtime env access.</strong>&nbsp;Remember — DefinePlugin replaces values at&nbsp;<em>build time</em>, not runtime. The browser never sees&nbsp;<code>process.env</code>; it only sees the already-substituted string.</li>
</ul>



<div class="wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-16018d1d wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://www.spguides.com/download-spfx-solutions/">Download Complete SPFx Solutions</a></div>
</div>



<h2 class="wp-block-heading">Conclusion</h2>



<p>I hope you found this article helpful. In this guide, I explained different ways to use <strong>environment variables in SPFx</strong>. I covered built-in variables, PowerShell options, .env files, and Webpack methods. I also shared recommended approaches and alternatives for different scenarios.</p>



<p>If you are working on SPFx projects, choose the method that fits your setup and needs. Start with simple options and move to advanced ones as required. Using environment variables will make your solution more flexible and easier to manage.</p>



<p>Also, you may like:</p>



<ul class="wp-block-list">
<li><a href="https://www.spguides.com/sharepoint-framework-crud-operations-using-react/">SharePoint Framework: CRUD Operations using ReactJS</a></li>



<li><a href="https://www.spguides.com/pnp-react-pagination-control-spfx/">PnP React Pagination Control in SharePoint Framework (SPFx) Web Part</a></li>



<li><a href="https://www.spguides.com/spfx-fluent-ui-react-choicegroup-and-checkbox/">SPFx Fluent UI React Control: ChoiceGroup and Checkbox</a></li>



<li><a href="https://www.spguides.com/fluent-ui-react-combobox-control-in-spfx/">Fluent UI React ComboBox Control in SPFx</a></li>
</ul>



<p></p>



<p></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>3 Different Methods to Set Microsoft Teams Work Hours [Complete Guide]</title>
		<link>https://www.spguides.com/set-microsoft-teams-work-hours/</link>
		
		<dc:creator><![CDATA[Bijay Kumar]]></dc:creator>
		<pubDate>Fri, 01 May 2026 11:00:00 +0000</pubDate>
				<category><![CDATA[Microsoft Teams]]></category>
		<category><![CDATA[Set Microsoft Teams Work Hours]]></category>
		<guid isPermaLink="false">https://www.spguides.com/?p=131715</guid>

					<description><![CDATA[If you&#8217;ve ever received a meeting invite at 7 PM on a Friday or had a colleague ping you on a Sunday morning, you already know why setting your work hours in Microsoft Teams matters. It&#8217;s not just about blocking distractions &#8211; it helps your whole team know when you&#8217;re available, when to expect a ... <a title="3 Different Methods to Set Microsoft Teams Work Hours [Complete Guide]" class="read-more" href="https://www.spguides.com/set-microsoft-teams-work-hours/" aria-label="Read more about 3 Different Methods to Set Microsoft Teams Work Hours [Complete Guide]">read more...</a>]]></description>
										<content:encoded><![CDATA[
<p>If you&#8217;ve ever received a <a href="https://www.spguides.com/delete-a-meeting-recording-in-microsoft-teams/">meeting</a> invite at 7 PM on a Friday or had a colleague ping you on a Sunday morning, you already know why setting your work hours in Microsoft Teams matters. It&#8217;s not just about blocking distractions &#8211; it helps your whole team know when you&#8217;re available, when to expect a reply, and when to simply leave you alone.</p>



<p>In this tutorial, I&#8217;ll walk you through every method to set your work hours in Microsoft Teams &#8211; from updating your <a href="https://www.spguides.com/power-automate-forward-meeting-invite-in-outlook/">Outlook calendar</a> settings to using the Shifts app and setting up quiet hours on mobile. Whether you&#8217;re a 9-to-5 person or someone working split shifts, there&#8217;s a setup here that works for you.</p>



<h2 class="wp-block-heading" id="why-work-hours-matter-in-teams">Why Work Hours Matter in Teams</h2>



<p>Before jumping into the steps, let me quickly explain what &#8220;work hours&#8221; actually does in Teams.</p>



<p>When you set your work hours, a few things happen:</p>



<ul class="wp-block-list">
<li>Colleagues can see your availability when scheduling meetings — they&#8217;ll see the shaded &#8220;outside work hours&#8221; zone in the scheduling assistant</li>



<li>Your status in Teams reflects when you&#8217;re active versus away</li>



<li>Notifications can be automatically silenced outside your set hours</li>



<li>Your work location (office or remote) can also be shared with your team</li>
</ul>



<p>This is especially useful if you&#8217;re on a team spread across different time zones or if you have a non-standard schedule.</p>



<h2 class="wp-block-heading">Set Microsoft Teams Work Hours</h2>



<p>Let&#8217;s see how to set <a href="https://teams.cloud.microsoft/" target="_blank" rel="noopener">Microsoft Teams</a> Work Hours.</p>



<h3 class="wp-block-heading" id="method-1-set-work-hours-through-outlook-the-main-w">Method 1: Set Work Hours Through Outlook (The Main Way)</h3>



<p>Here&#8217;s the thing most people don&#8217;t realize — Microsoft Teams doesn&#8217;t have a standalone &#8220;set work hours&#8221; toggle buried inside its own settings. Your work hours are actually controlled <span style="box-sizing: border-box; margin: 0px; padding: 0px;">in <strong>Outlook</strong>, and Teams pulls the</span>m from there. So this is where you need to start.</p>



<h4 class="wp-block-heading" id="using-outlook-on-the-web-recommended">Using Outlook on the Web (Recommended)</h4>



<p>This is the easiest method and works even if you don&#8217;t have Outlook desktop installed.</p>



<ol class="wp-block-list">
<li>Go to&nbsp;<a href="https://outlook.office.com/" target="_blank" rel="noreferrer noopener">outlook.office.com</a>&nbsp;and log in with your work account</li>



<li>Click the&nbsp;<strong>Settings gear icon</strong>&nbsp;(top right corner)</li>



<li>In the Settings panel, click on&nbsp;<strong>Calendar</strong></li>



<li>Click&nbsp;<strong>Work hours and location</strong></li>



<li>You&#8217;ll see a list of days from Monday to Sunday — check the boxes for the days you work</li>



<li>For each day, use the dropdown menus to set your&nbsp;<strong>start time</strong>&nbsp;and&nbsp;<strong>end time</strong></li>



<li>You can also set your&nbsp;<strong>work location</strong>&nbsp;here — choose &#8220;Office,&#8221; &#8220;Remote,&#8221; or &#8220;Unspecified&#8221; for each day</li>



<li>Hit&nbsp;<strong>Save</strong></li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f6f7f8" data-has-transparency="false" style="--dominant-color: #f6f7f8;" loading="lazy" decoding="async" width="1024" height="516" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/Set-Work-Hours-Through-Outlook-1024x516.avif" alt="Set Work Hours Through Outlook" class="wp-image-134280 not-transparent" title="Set Work Hours Through Outlook" srcset="https://www.spguides.com/wp-content/uploads/2026/04/Set-Work-Hours-Through-Outlook-1024x516.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/Set-Work-Hours-Through-Outlook-300x151.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/Set-Work-Hours-Through-Outlook-768x387.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/Set-Work-Hours-Through-Outlook-1536x775.avif 1536w, https://www.spguides.com/wp-content/uploads/2026/04/Set-Work-Hours-Through-Outlook.avif 1598w" /></figure></div>


<p>That&#8217;s it. Once saved, these hours will automatically appear in Teams. When anyone tries to schedule a meeting with you outside those hours, they&#8217;ll see a clear visual indicator that it falls outside your working time.</p>



<h4 class="wp-block-heading" id="using-outlook-desktop-classic-version">Using Outlook Desktop</h4>



<p>If you&#8217;re using the classic Outlook desktop app:</p>



<ol class="wp-block-list">
<li><a href="https://support.microsoft.com/en-us/office/use-the-web-version-of-outlook-like-a-desktop-app-b360bd9a-00dc-43a4-bdf8-71cdeeb78e83" target="_blank" rel="noopener">Open Outlook</a></li>



<li>Click&nbsp;<strong>File</strong>&nbsp;in the top-left corner</li>



<li>Go to&nbsp;<strong>Options</strong></li>



<li>Click on&nbsp;<strong>Calendar</strong>&nbsp;in the left sidebar</li>



<li>Under the&nbsp;<strong>Work time</strong>&nbsp;section, set your&nbsp;<strong>Start time</strong>&nbsp;and&nbsp;<strong>End time</strong></li>



<li>Check or uncheck the&nbsp;<strong>days of the week</strong>&nbsp;you work</li>



<li>Click&nbsp;<strong>OK</strong>&nbsp;to save</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="e5ecf2" data-has-transparency="false" style="--dominant-color: #e5ecf2;" loading="lazy" decoding="async" width="1024" height="479" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/Set-Microsoft-Teams-Work-Hours-1024x479.avif" alt="Set Microsoft Teams Work Hours" class="wp-image-134281 not-transparent" title="Set Microsoft Teams Work Hours" srcset="https://www.spguides.com/wp-content/uploads/2026/04/Set-Microsoft-Teams-Work-Hours-1024x479.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/Set-Microsoft-Teams-Work-Hours-300x140.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/Set-Microsoft-Teams-Work-Hours-768x359.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/Set-Microsoft-Teams-Work-Hours-1536x718.avif 1536w, https://www.spguides.com/wp-content/uploads/2026/04/Set-Microsoft-Teams-Work-Hours.avif 1919w" /></figure></div>


<p>One thing to keep in mind: the desktop Outlook method gives you a single, fixed schedule (the same hours every day). If you need different hours on different days (like a Tuesday/Thursday late start), the web version of Outlook gives you more flexibility.</p>



<h3 class="wp-block-heading" id="method-3-set-work-hours-using-the-shifts-app-for-s">Method 2: Set Work Hours Using the Shifts App in Teams (For Shift Workers)</h3>



<p>If you work shift patterns, like rotating schedules, morning/afternoon shifts, or you&#8217;re a manager building a team schedule, the Shifts app in Teams is built exactly for this.</p>



<h4 class="wp-block-heading" id="how-to-access-shifts">How to Access Shifts</h4>



<ol class="wp-block-list">
<li>In Teams, click on&nbsp;<strong>Apps</strong>&nbsp;in the left navigation bar (looks like a grid icon)</li>



<li>Search for&nbsp;<strong>Shifts</strong>&nbsp;and open it (or add it if you haven&#8217;t already)</li>



<li>If you&#8217;re a manager, you can create a <a href="https://www.spguides.com/add-new-attendee-to-meeting-without-email-others-power-automate/">new schedule</a> or open an existing one</li>



<li>Click&nbsp;<strong>New shift</strong>&nbsp;to add a shift block — set the time range (e.g., 9:00 AM to 2:00 PM)</li>



<li>Assign it to yourself or a team member</li>



<li>Once the schedule looks right, click&nbsp;<strong>Publish</strong>&nbsp;to make it visible to your team</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f2f0f0" data-has-transparency="false" style="--dominant-color: #f2f0f0;" loading="lazy" decoding="async" width="1024" height="235" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/Set-Work-Hours-Using-the-Shifts-App-in-Teams-1024x235.avif" alt="Set Work Hours Using the Shifts App in Teams" class="wp-image-134292 not-transparent" title="Set Work Hours Using the Shifts App in Teams" srcset="https://www.spguides.com/wp-content/uploads/2026/04/Set-Work-Hours-Using-the-Shifts-App-in-Teams-1024x235.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/Set-Work-Hours-Using-the-Shifts-App-in-Teams-300x69.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/Set-Work-Hours-Using-the-Shifts-App-in-Teams-768x176.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/Set-Work-Hours-Using-the-Shifts-App-in-Teams-1536x353.avif 1536w, https://www.spguides.com/wp-content/uploads/2026/04/Set-Work-Hours-Using-the-Shifts-App-in-Teams.avif 1916w" /></figure></div>


<p>From an employee&#8217;s side, you can open Shifts to see your upcoming schedule, swap shifts, or request time off — all inside Teams.</p>



<p>The Shifts app is particularly useful in industries like retail, healthcare, or customer support, where schedules change weekly and team member overlap needs to be managed clearly.</p>



<h3 class="wp-block-heading" id="method-4-set-quiet-hours-on-teams-mobile">Method 3: Set Quiet Hours on Teams Mobile</h3>



<p>Work hours settings in Outlook control how you appear to others. But what if you want Teams to actually&nbsp;<strong>stop buzzing your phone</strong>&nbsp;after 6 PM? That&#8217;s where&nbsp;<strong>Quiet Hours</strong>&nbsp;comes in — and this one lives inside the Teams mobile app.</p>



<h4 class="wp-block-heading" id="setting-up-quiet-hours-on-android-or-ios">Setting Up Quiet Hours on Android or iOS</h4>



<ol class="wp-block-list">
<li>Open the&nbsp;<strong>Microsoft Teams app</strong>&nbsp;on your phone</li>



<li>Tap your&nbsp;<strong>profile picture</strong>&nbsp;or the menu icon (top-left corner)</li>



<li>Tap&nbsp;<strong>Notifications</strong></li>



<li>Under&nbsp;<strong>Block notifications</strong>, tap&nbsp;<strong>Block during quiet hours</strong></li>



<li>You&#8217;ll see two options:
<ul class="wp-block-list">
<li><strong>Certain hours</strong>&nbsp;— toggle this on, then set a start and end time for daily silence (e.g., 6:00 PM to 8:00 AM)</li>



<li><strong>All days</strong>&nbsp;— toggle specific days completely off (great for weekends)</li>
</ul>
</li>



<li>Save your settings</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f5f4f5" data-has-transparency="false" style="--dominant-color: #f5f4f5;" loading="lazy" decoding="async" width="1024" height="442" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/Set-Quiet-Hours-on-Teams-Mobile-1024x442.avif" alt="Set Quiet Hours on Teams Mobile" class="wp-image-134295 not-transparent" title="Set Quiet Hours on Teams Mobile" srcset="https://www.spguides.com/wp-content/uploads/2026/04/Set-Quiet-Hours-on-Teams-Mobile-1024x442.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/Set-Quiet-Hours-on-Teams-Mobile-300x129.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/Set-Quiet-Hours-on-Teams-Mobile-768x331.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/Set-Quiet-Hours-on-Teams-Mobile-1536x663.avif 1536w, https://www.spguides.com/wp-content/uploads/2026/04/Set-Quiet-Hours-on-Teams-Mobile-2048x884.avif 2048w" /></figure></div>


<p>Once this is set, Teams will not send you any push notifications during your quiet hours — no chat pings, no call alerts, nothing. You&#8217;ll still receive the messages, but they&#8217;ll wait silently until your next working window.</p>



<p>This is one of my favorite features for maintaining a healthy boundary between work and personal time, especially if your team is spread across time zones and messages come in at odd hours.</p>



<h2 class="wp-block-heading" id="what-your-colleagues-see-when-you-set-work-hours">What Your Colleagues See When You Set Work Hours</h2>



<p>Here&#8217;s a practical example that shows why this matters.</p>



<p>Imagine you work from 10:00 AM to 6:00 PM. A colleague wants to <a href="https://www.spguides.com/turn-on-translate-in-microsoft-teams/">schedule a meeting</a> at 8:00 AM. When they open the <strong>Scheduling Assistant</strong> in Outlook or Teams, they&#8217;ll see a shaded/blocked section on your calendar for 8:00 AM — a clear visual signal that it&#8217;s outside your work hours.</p>



<p>This saves a ton of back-and-forth. Your colleague will naturally shift the meeting to 10:00 AM or later without even asking you.</p>



<p>Also, when someone hovers over your profile in Teams, they can see your set work location for the day (office or remote). This small detail is surprisingly useful for hybrid teams trying to coordinate in-person days.</p>



<h2 class="wp-block-heading" id="updating-your-work-hours-when-your-schedule-change">Updating Your Work Hours When Your Schedule Changes</h2>



<p>Life changes, and so do schedules. Here&#8217;s a quick checklist for keeping things current:</p>



<ul class="wp-block-list">
<li><strong>Changed your working days?</strong> Go back to Outlook Web > Settings > Calendar > Work hours and location, and update the day checkboxes</li>



<li><strong>Shifted to a new time zone?</strong>&nbsp;Update your time zone in Outlook Calendar settings — Teams will pick it up automatically</li>



<li><strong>Started working hybrid?</strong>&nbsp;Use the Work Plans feature in Teams to update your office/remote days each week</li>



<li><strong>Going on vacation?</strong>&nbsp;Set an Out of Office message in Outlook — this overrides your work hours and lets people know you&#8217;re away</li>
</ul>



<h2 class="wp-block-heading" id="a-few-tips-to-get-the-most-out-of-this">A Few Tips to Get the Most Out of This</h2>



<ul class="wp-block-list">
<li><strong>Don&#8217;t set fake hours.</strong>&nbsp;If you realistically start at 9:30 AM, set 9:30. Setting 8:00 AM and never responding until 10:00 AM just frustrates people</li>



<li><strong>Sync with your manager.</strong>&nbsp;If your team uses Shifts, make sure your manager publishes your schedule so everyone&#8217;s on the same page</li>



<li><strong>Combine methods.</strong>&nbsp;Use Outlook for calendar-level work hours, and use Quiet Hours on mobile to actually mute your phone. These two together give you the best experience</li>



<li><strong>Check the scheduling assistant.</strong>&nbsp;Before sending a meeting invite to a colleague, use the Scheduling Assistant in Teams or Outlook to see their work hours — it saves everyone time</li>
</ul>



<h2 class="wp-block-heading" id="wrapping-up">Conclusion</h2>



<p>At the end of the day, setting your work hours in Microsoft Teams is a small step that makes a big difference. It helps you stay focused during work time and gives you the space to disconnect when the day is done. More importantly, it sets clear expectations for your team so everyone knows when you’re available and when you’re not.</p>



<p>Whether you use Outlook, the Shifts app, or quiet hours on mobile, the goal is the same — better balance and fewer interruptions. Take a few minutes to set it up properly, and your future self (and your teammates) will thank you for it.</p>



<p>Also, you may like:</p>



<ul class="wp-block-list">
<li><a href="https://www.spguides.com/zoom-in-on-microsoft-teams/">Zoom In on Microsoft Teams</a></li>



<li><a href="https://www.spguides.com/archive-files-in-microsoft-teams/">Archive Files in Microsoft Teams</a></li>



<li><a href="https://www.spguides.com/enable-gifs-in-microsoft-teams/">Enable GIFs in Microsoft Teams</a></li>



<li><a href="https://www.spguides.com/take-a-screenshot-in-microsoft-teams/">6 Easiest Ways to Take a Screenshot in Microsoft Teams</a></li>
</ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Power Apps DateAdd Function: With UseCase Examples</title>
		<link>https://www.spguides.com/power-apps-dateadd-function/</link>
		
		<dc:creator><![CDATA[Bijay Kumar]]></dc:creator>
		<pubDate>Thu, 30 Apr 2026 11:00:00 +0000</pubDate>
				<category><![CDATA[Power Apps]]></category>
		<category><![CDATA[Power Apps DateAdd Function]]></category>
		<guid isPermaLink="false">https://www.spguides.com/?p=132572</guid>

					<description><![CDATA[If you&#8217;ve spent any time building apps in Power Apps, you&#8217;ve probably run into a situation where you need to work with dates — calculate a due date, find records from the last 30 days, auto-fill an expiry date, or convert UTC time to local time. That&#8217;s exactly where the&#160;DateAdd function&#160;comes in. It&#8217;s simple, flexible, ... <a title="Power Apps DateAdd Function: With UseCase Examples" class="read-more" href="https://www.spguides.com/power-apps-dateadd-function/" aria-label="Read more about Power Apps DateAdd Function: With UseCase Examples">read more...</a>]]></description>
										<content:encoded><![CDATA[
<p>If you&#8217;ve spent any time <a href="https://www.tsinfotechnologies.com/expense-claim-request-power-apps-app/" target="_blank" rel="noopener">building apps in Power Apps</a>, you&#8217;ve probably run into a situation where you need to work with dates — calculate a due date, find records from the last 30 days, auto-fill an expiry date, or convert UTC time to local time.</p>



<p>That&#8217;s exactly where the&nbsp;<strong>DateAdd function</strong>&nbsp;comes in. It&#8217;s simple, flexible, and once you understand how it works, you&#8217;ll use it in almost every app you build.</p>



<p>In this guide, I&#8217;ll walk you through everything — the syntax, every supported unit, practical examples you can use right away, common mistakes to avoid, and how to combine DateAdd with other functions to solve real problems.</p>



<h2 class="wp-block-heading" id="what-is-the-power-apps-dateadd-function">Power Apps DateAdd Function</h2>



<p>DateAdd is a built-in <a href="https://www.spguides.com/power-apps-refresh-function/">Power Apps function</a> that adds or subtracts a specific amount of time from a date or date-time value. You give it a starting date, a number, and a unit (like days, months, or hours), and it returns a new date shifted by that amount.</p>



<p>It&#8217;s like telling Power Apps:&nbsp;<em>&#8220;Take this date, move it forward 30 days, and give me that new date.&#8221;</em></p>



<p>You&#8217;ll use it for things like:</p>



<ul class="wp-block-list">
<li>Auto-calculating due dates in forms</li>



<li>Filtering galleries to show records from the last X days</li>



<li>Setting expiry or renewal dates</li>



<li>Converting UTC timestamps to local time</li>



<li>Building date-based conditional logic</li>
</ul>



<h2 class="wp-block-heading" id="power-apps-dateadd-syntax-and-parameters">Power Apps DateAdd Syntax and Parameters</h2>



<pre class="wp-block-preformatted">DateAdd( DateTime, Addition [, Units] )</pre>



<p>Here&#8217;s what each parameter means:</p>



<ul class="wp-block-list">
<li><strong>DateTime</strong> — Your starting date or date-time value. This can be <code>Today()</code>, <code>Now()</code>, a date picker value, a <a href="https://www.spguides.com/disable-include-time-option-in-sharepoint-list-date-time-column-using-power-automate/">SharePoint date column</a>, or a variable. This is required.</li>



<li><strong>Addition</strong>&nbsp;— How much to add. This is a number. Pass a&nbsp;<strong>positive</strong>&nbsp;number to go forward in time, a&nbsp;<strong>negative</strong>&nbsp;number to go backward. Required.</li>



<li><strong>Units</strong>&nbsp;— The unit of time you&#8217;re working with. This is optional. If you leave it out, Power Apps defaults to&nbsp;<strong>Days</strong>.</li>
</ul>



<h2 class="wp-block-heading" id="all-timeunit-values-you-can-use-in-dateadd">All TimeUnit Values You Can Use in Power Apps DateAdd()</h2>



<p>Power Apps supports eight units in the DateAdd function. Here&#8217;s all of them:</p>



<figure class="wp-block-table is-style-stripes"><table class="has-fixed-layout"><thead><tr><th>TimeUnit Value</th><th>What It Means</th></tr></thead><tbody><tr><td><code>TimeUnit.Milliseconds</code></td><td>Milliseconds</td></tr><tr><td><code>TimeUnit.Seconds</code></td><td>Seconds</td></tr><tr><td><code>TimeUnit.Minutes</code></td><td>Minutes</td></tr><tr><td><code>TimeUnit.Hours</code></td><td>Hours</td></tr><tr><td><code>TimeUnit.Days</code></td><td>Days&nbsp;<em>(default if omitted)</em></td></tr><tr><td><code>TimeUnit.Months</code></td><td>Calendar months</td></tr><tr><td><code>TimeUnit.Quarters</code></td><td>Three-month periods</td></tr><tr><td><code>TimeUnit.Years</code></td><td>Full calendar years</td></tr></tbody></table></figure>



<p>A small but important note: when you use&nbsp;<code>TimeUnit.Months</code>&nbsp;or&nbsp;<code>TimeUnit.Years</code>, Power Apps handles the calendar math for you. So adding 1 month to January 31 gives you February 28 (or 29 in a leap year) — Power Apps won&#8217;t overflow into March.</p>



<h2 class="wp-block-heading" id="how-to-add-days-to-a-date-in-power-apps">How to Add Days to a Date in Power Apps</h2>



<p>The most common use case in Power Apps is adding days. The syntax is straightforward:</p>



<pre class="wp-block-preformatted">DateAdd(Today(), 10, TimeUnit.Days)</pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f5f3f3" data-has-transparency="false" style="--dominant-color: #f5f3f3;" loading="lazy" decoding="async" width="908" height="384" sizes="(max-width: 908px) 100vw, 908px" src="https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd.avif" alt="power apps dateadd()" class="wp-image-134314 not-transparent" title="power apps dateadd" srcset="https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd.avif 908w, https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd-300x127.avif 300w, https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd-768x325.avif 768w" /></figure></div>


<p>You can also skip the unit entirely since Days is the default:</p>



<pre class="wp-block-preformatted">DateAdd(Today(), 10)</pre>



<p>I&#8217;d still recommend explicitly including the unit. It makes your formula easier to read, especially when someone else (or future you) looks at it months later.</p>



<h2 class="wp-block-heading" id="how-to-add-months-quarters-and-years-using-dateadd">How to Add Months, Quarters, and Years Using Power Apps DateAdd()</h2>



<p>Let&#8217;s see some examples:</p>



<h3 class="wp-block-heading" id="adding-months">Adding Months</h3>



<pre class="wp-block-preformatted">DateAdd(Today(), 3, TimeUnit.Months)</pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f6f5f5" data-has-transparency="false" style="--dominant-color: #f6f5f5;" loading="lazy" decoding="async" width="922" height="398" sizes="(max-width: 922px) 100vw, 922px" src="https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd-month.avif" alt="power apps dateadd month" class="wp-image-134316 not-transparent" title="power apps dateadd month" srcset="https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd-month.avif 922w, https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd-month-300x130.avif 300w, https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd-month-768x332.avif 768w" /></figure></div>


<p>This is perfect for quarterly billing cycles, trial period ends, or anything measured in months.</p>



<h3 class="wp-block-heading" id="adding-quarters">Adding Quarters</h3>



<pre class="wp-block-preformatted">DateAdd(Today(), 2, TimeUnit.Quarters)</pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f5f4f4" data-has-transparency="false" style="--dominant-color: #f5f4f4;" loading="lazy" decoding="async" width="892" height="390" sizes="(max-width: 892px) 100vw, 892px" src="https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd-function-quarters-month.avif" alt="power apps dateadd function quarters month" class="wp-image-134317 not-transparent" title="power apps dateadd function quarters month" srcset="https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd-function-quarters-month.avif 892w, https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd-function-quarters-month-300x131.avif 300w, https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd-function-quarters-month-768x336.avif 768w" /></figure></div>


<p>Two quarters = six months. You could achieve the same with&nbsp;<code>6, TimeUnit.Months</code>, but Quarters is cleaner when your logic is explicitly quarter-based.</p>



<h3 class="wp-block-heading" id="adding-years">Adding Years</h3>



<pre class="wp-block-preformatted">DateAdd(Today(), 1, TimeUnit.Years)</pre>



<p>Useful for annual renewals, subscription expiry dates, or year-over-year comparisons.</p>



<h2 class="wp-block-heading" id="how-to-add-hours-minutes-and-seconds-using-dateadd">Add Hours, Minutes, and Seconds Using Power Apps DateAdd()</h2>



<p>When you&#8217;re working with time (not just dates), use&nbsp;<code>Now()</code>&nbsp;instead of&nbsp;<code>Today()</code>&nbsp;as your starting point.&nbsp;<code>Now()</code>&nbsp;returns the current date&nbsp;<strong>and</strong>&nbsp;time.&nbsp;<code>Today()</code>&nbsp;returns only the date at midnight.</p>



<h3 class="wp-block-heading" id="adding-hours">Adding Hours</h3>



<pre class="wp-block-preformatted">DateAdd(Now(), 4, TimeUnit.Hours)</pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f6f4f4" data-has-transparency="false" style="--dominant-color: #f6f4f4;" loading="lazy" decoding="async" width="886" height="406" sizes="(max-width: 886px) 100vw, 886px" src="https://www.spguides.com/wp-content/uploads/2026/03/power-apps-add-hours-to-date.avif" alt="power apps add hours to date" class="wp-image-134318 not-transparent" title="power apps add hours to date" srcset="https://www.spguides.com/wp-content/uploads/2026/03/power-apps-add-hours-to-date.avif 886w, https://www.spguides.com/wp-content/uploads/2026/03/power-apps-add-hours-to-date-300x137.avif 300w, https://www.spguides.com/wp-content/uploads/2026/03/power-apps-add-hours-to-date-768x352.avif 768w" /></figure></div>


<h3 class="wp-block-heading" id="adding-minutes">Adding Minutes</h3>



<pre class="wp-block-preformatted">DateAdd(Now(), 30, TimeUnit.Minutes)</pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f6f4f4" data-has-transparency="false" style="--dominant-color: #f6f4f4;" loading="lazy" decoding="async" width="894" height="378" sizes="(max-width: 894px) 100vw, 894px" src="https://www.spguides.com/wp-content/uploads/2026/03/power-apps-add-minutes-to-hours-to-date.avif" alt="power apps add minutes to hours to date" class="wp-image-134319 not-transparent" title="power apps add minutes to hours to date" srcset="https://www.spguides.com/wp-content/uploads/2026/03/power-apps-add-minutes-to-hours-to-date.avif 894w, https://www.spguides.com/wp-content/uploads/2026/03/power-apps-add-minutes-to-hours-to-date-300x127.avif 300w, https://www.spguides.com/wp-content/uploads/2026/03/power-apps-add-minutes-to-hours-to-date-768x325.avif 768w" /></figure></div>


<h3 class="wp-block-heading" id="adding-seconds">Adding Seconds</h3>



<pre class="wp-block-preformatted">DateAdd(Now(), 90, TimeUnit.Seconds)</pre>



<h2 class="wp-block-heading" id="how-to-subtract-dates-in-power-apps-using-dateadd">Subtract Dates in Power Apps Using DateAdd</h2>



<p>There&#8217;s no separate &#8220;DateSubtract&#8221; function in Power Apps. You subtract dates by simply passing a&nbsp;<strong>negative number</strong>&nbsp;as the Addition parameter.</p>



<h3 class="wp-block-heading" id="subtract-days">Subtract Days</h3>



<pre class="wp-block-preformatted">DateAdd(Today(), -7, TimeUnit.Days)</pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f4f2f3" data-has-transparency="false" style="--dominant-color: #f4f2f3;" loading="lazy" decoding="async" width="920" height="386" sizes="(max-width: 920px) 100vw, 920px" src="https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd-to-subtract-date.avif" alt="power apps dateadd() to subtract date" class="wp-image-134320 not-transparent" title="power apps dateadd to subtract date" srcset="https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd-to-subtract-date.avif 920w, https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd-to-subtract-date-300x126.avif 300w, https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd-to-subtract-date-768x322.avif 768w" /></figure></div>


<h3 class="wp-block-heading" id="subtract-months">Subtract Months</h3>



<pre class="wp-block-preformatted">DateAdd(Today(), -3, TimeUnit.Months)</pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f6f4f4" data-has-transparency="false" style="--dominant-color: #f6f4f4;" loading="lazy" decoding="async" width="894" height="400" sizes="(max-width: 894px) 100vw, 894px" src="https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd-to-subtract-months.avif" alt="power apps dateadd() to subtract months" class="wp-image-134322 not-transparent" title="power apps dateadd to subtract months" srcset="https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd-to-subtract-months.avif 894w, https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd-to-subtract-months-300x134.avif 300w, https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd-to-subtract-months-768x344.avif 768w" /></figure></div>


<h3 class="wp-block-heading" id="subtract-years">Subtract Years</h3>



<pre class="wp-block-preformatted">DateAdd(Today(), -2, TimeUnit.Years)</pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f6f4f4" data-has-transparency="false" style="--dominant-color: #f6f4f4;" loading="lazy" decoding="async" width="906" height="390" sizes="(max-width: 906px) 100vw, 906px" src="https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd-to-subtract-years.avif" alt="power apps dateadd() to subtract years" class="wp-image-134324 not-transparent" title="power apps dateadd to subtract years" srcset="https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd-to-subtract-years.avif 906w, https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd-to-subtract-years-300x129.avif 300w, https://www.spguides.com/wp-content/uploads/2026/03/power-apps-dateadd-to-subtract-years-768x331.avif 768w" /></figure></div>


<h3 class="wp-block-heading" id="subtract-hours-from-now">Subtract Hours from Now</h3>



<pre class="wp-block-preformatted">DateAdd(Now(), -2, TimeUnit.Hours)</pre>



<p>This pattern — using negative numbers to go back in time — is one of the most frequently used patterns in real apps, especially for filtering galleries to show recent records.</p>



<h2 class="wp-block-heading" id="power-apps-dateadd-with-real-world-examples">Power Apps DateAdd with Real-World Examples</h2>



<p>Now let me show you the practical scenarios where you&#8217;ll actually use this in your apps.</p>



<h3 class="wp-block-heading" id="example-1-auto-fill-a-due-date-in-a-power-apps-for">Example 1: Auto-Fill a Due Date in a Power Apps Form</h3>



<p>You have a form where users log tasks. You want the Due Date field to automatically default to 14 days from today, but users can still change it.</p>



<p>Set the&nbsp;<strong>DefaultDate</strong>&nbsp;property of your <a href="https://www.spguides.com/date-time-picker-in-powerapps/">Date Picker control </a>to:</p>



<pre class="wp-block-preformatted">DateAdd(Today(), 14, TimeUnit.Days)</pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f5f3f4" data-has-transparency="false" style="--dominant-color: #f5f3f4;" loading="lazy" decoding="async" width="846" height="390" sizes="(max-width: 846px) 100vw, 846px" src="https://www.spguides.com/wp-content/uploads/2026/04/power-apps-prefill-dateadd.avif" alt="power apps prefill dateadd" class="wp-image-134327 not-transparent" title="power apps prefill dateadd" srcset="https://www.spguides.com/wp-content/uploads/2026/04/power-apps-prefill-dateadd.avif 846w, https://www.spguides.com/wp-content/uploads/2026/04/power-apps-prefill-dateadd-300x138.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/power-apps-prefill-dateadd-768x354.avif 768w" /></figure></div>


<p>That&#8217;s it. The field pre-fills 14 days out when the form opens, and the user can override it if needed.</p>



<h3 class="wp-block-heading" id="example-2-calculate-a-contract-or-subscription-exp">Example 2: Power Apps Calculate a Contract or Subscription Expiry Date</h3>



<p>A contract is signed on a specific date and lasts 1 year. Auto-calculate the expiry date from the signed date:</p>



<pre class="wp-block-preformatted">DateAdd(DatePicker_ContractStart.SelectedDate, 1, TimeUnit.Years)</pre>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f7f5f6" data-has-transparency="false" style="--dominant-color: #f7f5f6;" loading="lazy" decoding="async" width="1024" height="367" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/power-apps-calculate-days-between-dates-1024x367.avif" alt="power apps calculate days between dates" class="wp-image-134329 not-transparent" title="power apps calculate days between dates" srcset="https://www.spguides.com/wp-content/uploads/2026/04/power-apps-calculate-days-between-dates-1024x367.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/power-apps-calculate-days-between-dates-300x107.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/power-apps-calculate-days-between-dates-768x275.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/power-apps-calculate-days-between-dates.avif 1184w" /></figure></div>


<p>You can display this in a label next to the form so users immediately see the expiry date as they fill in the start date.</p>



<h3 class="wp-block-heading" id="example-3-filter-a-sharepoint-gallery-to-show-last">Example 3: Filter a Power Apps Gallery to Show Last 30 Days</h3>



<p>This is one of the most practical DateAdd formulas you&#8217;ll write. Say you have a <a href="https://www.spguides.com/power-apps-search-sharepoint-list/">SharePoint list </a>and you want to show only records created in the last 30 days:</p>



<pre class="wp-block-preformatted">Filter(<br>    YourSharePointList,<br>    Created &gt;= DateAdd(Today(), -30, TimeUnit.Days)<br>)</pre>



<p>Replace&nbsp;<code>YourSharePointList</code>&nbsp;with your actual data source name and&nbsp;<code>Created</code>&nbsp;with your date column. For Dataverse, this works the same way.</p>



<h3 class="wp-block-heading" id="example-4-show-records-due-in-the-next-7-days">Example 4: Show Records Due in the Next 7 Days in Power Apps</h3>



<p>Want a &#8220;this week&#8217;s tasks&#8221; view in your <a href="https://www.spguides.com/sort-power-apps-data-table-based-on-sharepoint-choice-column/">Power Apps Data Table</a>? Use DateAdd on both ends of a date range:</p>



<pre class="wp-block-preformatted">Filter(<br>    Tasks,<br>    DueDate &gt;= Today() &amp;&amp; DueDate &lt;= DateAdd(Today(), 7, TimeUnit.Days)<br>)</pre>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="eaeef3" data-has-transparency="false" style="--dominant-color: #eaeef3;" loading="lazy" decoding="async" width="1024" height="348" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/power-apps-filter-sharepoint-list-items-based-on-date-1024x348.avif" alt="power apps filter sharepoint list items based on date" class="wp-image-134332 not-transparent" title="power apps filter sharepoint list items based on date" srcset="https://www.spguides.com/wp-content/uploads/2026/04/power-apps-filter-sharepoint-list-items-based-on-date-1024x348.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/power-apps-filter-sharepoint-list-items-based-on-date-300x102.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/power-apps-filter-sharepoint-list-items-based-on-date-768x261.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/power-apps-filter-sharepoint-list-items-based-on-date.avif 1370w" /></figure></div>


<p>This shows only items where the due date falls between today and 7 days from now.</p>



<h3 class="wp-block-heading" id="example-5-build-a-date-range-picker-with-dateadd">Example 5: Build a Power Apps Date Range Picker with DateAdd</h3>



<p>If you want to let users select a start date and automatically set the end date as 30 days later:</p>



<pre class="wp-block-preformatted">DateAdd(DatePicker_StartDate.SelectedDate, 30, TimeUnit.Days)</pre>



<p>As the user picks a start date, the end date updates automatically.</p>



<h3 class="wp-block-heading" id="example-6-highlight-overdue-items-with-conditional">Example 6: Highlight Overdue Items with Conditional Formatting in Power Apps</h3>



<p>Use DateAdd with conditional formatting to turn overdue records red in a <a href="https://www.spguides.com/show-file-type-icons-in-power-apps-gallery/">Power Apps Gallery</a>. In the&nbsp;<strong>TemplateFill&nbsp;</strong>property of a label or container:</p>



<pre class="wp-block-preformatted">If(<br>   ThisItem.'Due Date' &lt; Today(),<br>    RGBA(255, 0, 0, 0.1),<br>    RGBA(0, 0, 0, 0)<br>)</pre>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f6f3f3" data-has-transparency="false" style="--dominant-color: #f6f3f3;" loading="lazy" decoding="async" width="1024" height="371" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/highlight-overdue-items-with-conditional-formatting-power-apps-1024x371.avif" alt="highlight overdue items with conditional formatting power apps" class="wp-image-134333 not-transparent" title="highlight overdue items with conditional formatting power apps" srcset="https://www.spguides.com/wp-content/uploads/2026/04/highlight-overdue-items-with-conditional-formatting-power-apps-1024x371.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/highlight-overdue-items-with-conditional-formatting-power-apps-300x109.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/highlight-overdue-items-with-conditional-formatting-power-apps-768x278.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/highlight-overdue-items-with-conditional-formatting-power-apps.avif 1230w" /></figure></div>


<p>And if you want to highlight items due within the next 3 days in yellow:</p>



<pre class="wp-block-preformatted">If(<br>    DueDate &lt; Today(),<br>    RGBA(255, 0, 0, 0.1),<br>    DueDate &lt;= DateAdd(Today(), 3, TimeUnit.Days),<br>    RGBA(255, 255, 0, 0.2),<br>    RGBA(0, 0, 0, 0)<br>)</pre>



<h3 class="wp-block-heading" id="example-7-add-multiple-time-units--nesting-dateadd">Example 7: Add Multiple Time Units — Nesting Power Apps DateAdd</h3>



<p>DateAdd only accepts one unit per call. But what if you need to add both 2 months and 15 days? Just nest two DateAdd calls:</p>



<pre class="wp-block-preformatted">DateAdd(DateAdd(Today(), 2, TimeUnit.Months), 15, TimeUnit.Days)</pre>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f6f5f5" data-has-transparency="false" style="--dominant-color: #f6f5f5;" loading="lazy" decoding="async" width="1024" height="345" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/add-multiple-time-units-nesting-dateadd-in-power-apps-1024x345.avif" alt="add multiple time units nesting dateadd() in power apps" class="wp-image-134335 not-transparent" title="add multiple time units nesting dateadd in power apps" srcset="https://www.spguides.com/wp-content/uploads/2026/04/add-multiple-time-units-nesting-dateadd-in-power-apps-1024x345.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/add-multiple-time-units-nesting-dateadd-in-power-apps-300x101.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/add-multiple-time-units-nesting-dateadd-in-power-apps-768x259.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/add-multiple-time-units-nesting-dateadd-in-power-apps.avif 1134w" /></figure></div>


<p>The inner call adds 2 months first. Then the outer call adds 15 days to that result. Clean and readable.</p>



<h3 class="wp-block-heading" id="example-8-convert-utc-to-local-time-using-dateadd">Example 8: Convert UTC to Local Time Using DateAdd and TimeZoneOffset</h3>



<p>SharePoint stores all date-time values in&nbsp;<strong>UTC</strong>. If your app displays a timestamp from a <a href="https://www.spguides.com/set-power-apps-dropdown-default-value-from-sharepoint-list/">SharePoint list</a> and it looks off by a few hours, this is why.</p>



<p>Here&#8217;s how to convert UTC to the user&#8217;s local time:</p>



<pre class="wp-block-preformatted">DateAdd(UTCDateTimeColumn, -TimeZoneOffset(), TimeUnit.Minutes)</pre>



<p><code>TimeZoneOffset()</code>&nbsp;returns the difference in minutes between UTC and the local time on the user&#8217;s device. The negative sign flips it from UTC to local.</p>



<p>And if you need to go the other way — convert local to UTC before saving to SharePoint:</p>



<pre class="wp-block-preformatted">DateAdd(Now(), TimeZoneOffset(), TimeUnit.Minutes)</pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f6f4f5" data-has-transparency="false" style="--dominant-color: #f6f4f5;" loading="lazy" decoding="async" width="1008" height="390" sizes="(max-width: 1008px) 100vw, 1008px" src="https://www.spguides.com/wp-content/uploads/2026/04/power-apps-add-different-time-zones.avif" alt="power apps add different time zones" class="wp-image-134337 not-transparent" title="power apps add different time zones" srcset="https://www.spguides.com/wp-content/uploads/2026/04/power-apps-add-different-time-zones.avif 1008w, https://www.spguides.com/wp-content/uploads/2026/04/power-apps-add-different-time-zones-300x116.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/power-apps-add-different-time-zones-768x297.avif 768w" /></figure></div>


<p>This is one of the most practical (and most searched) Power Apps date questions, so it&#8217;s worth understanding well.</p>



<h3 class="wp-block-heading" id="example-9-using-dateadd-with-a-date-variable">Example 9: Power Apps DateAdd with a Date Variable</h3>



<p>You can use DateAdd on any date value, not just&nbsp;<code>Today()</code>&nbsp;or&nbsp;<code>Now()</code>. Here&#8217;s how to use it with a variable:</p>



<pre class="wp-block-preformatted">// First, set a date variable<br>Set(varProjectStart, DateValue("2026-01-15"));<br><br>// Then use DateAdd on that variable<br>DateAdd(varProjectStart, 90, TimeUnit.Days)<br>// Result: April 15, 2026</pre>



<p>This is useful when you&#8217;re calculating dates based on values the user already entered earlier in the app.</p>



<h3 class="wp-block-heading" id="example-10-use-dateadd-with-text-to-format-the-out">Example 10: Use DateAdd with Power Apps Text() to Format the Output</h3>



<p>DateAdd returns a date/time value. If you want to display it nicely in a label, wrap it in the&nbsp;<code>Text()</code>&nbsp;function:</p>



<pre class="wp-block-preformatted">Text(DateAdd(Today(), 30, TimeUnit.Days), "dd/mm/yyyy")</pre>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f6f5f5" data-has-transparency="false" style="--dominant-color: #f6f5f5;" loading="lazy" decoding="async" width="1024" height="374" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/powerapps-format-date-dd-mm-yyyy-1024x374.avif" alt="powerapps format date dd-mm-yyyy" class="wp-image-134338 not-transparent" title="powerapps format date dd mm yyyy" srcset="https://www.spguides.com/wp-content/uploads/2026/04/powerapps-format-date-dd-mm-yyyy-1024x374.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/powerapps-format-date-dd-mm-yyyy-300x110.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/powerapps-format-date-dd-mm-yyyy-768x280.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/powerapps-format-date-dd-mm-yyyy.avif 1052w" /></figure></div>


<p>Or in a more readable format:</p>



<pre class="wp-block-preformatted">Text(DateAdd(Today(), 30, TimeUnit.Days), "mmmm dd, yyyy")</pre>



<h2 class="wp-block-heading" id="power-apps-dateadd-vs-datediff--whats-the-differen">Power Apps DateAdd vs DateDiff — What&#8217;s the Difference?</h2>



<p>People often confuse these two. Here&#8217;s the quick distinction:</p>



<ul class="wp-block-list">
<li><strong>DateAdd</strong>&nbsp;— Takes a date and adds/subtracts time from it. Returns a&nbsp;<strong>new date</strong>.</li>



<li><strong>DateDiff</strong>&nbsp;— Takes two dates and measures the gap between them. Returns a&nbsp;<strong>number</strong>.</li>
</ul>



<p>So:</p>



<ul class="wp-block-list">
<li><em>&#8220;What date is 30 days from today?&#8221;</em>&nbsp;→ Use&nbsp;<strong>DateAdd</strong></li>



<li><em>&#8220;How many days between date A and date B?&#8221;</em>&nbsp;→ Use&nbsp;<strong>DateDiff</strong></li>
</ul>



<p>Example of DateDiff for comparison:</p>



<pre class="wp-block-preformatted">DateDiff(Today(), DateValue("2026-12-31"), TimeUnit.Days)</pre>



<p>You&#8217;ll often use them together. DateAdd to set a target date, DateDiff to calculate how far away it is.</p>



<h2 class="wp-block-heading" id="common-dateadd-mistakes-and-how-to-fix-them">Common Power Apps DateAdd Mistakes and How to Fix Them</h2>



<p><strong>1. Passing a text string instead of a date value</strong></p>



<p>This will NOT work:</p>



<pre class="wp-block-preformatted">DateAdd("2026-03-22", 10, TimeUnit.Days) // Error!</pre>



<p>You need to convert the string to a date first using&nbsp;<code>DateValue()</code>:</p>



<pre class="wp-block-preformatted">DateAdd(DateValue("2026-03-22"), 10, TimeUnit.Days) // Works!</pre>



<p><strong>2. Forgetting that Today() returns midnight</strong></p>



<p><code>Today()</code>&nbsp;gives you the current date at 12:00 AM. If you&#8217;re working with time-sensitive logic and need the actual current time, use&nbsp;<code>Now()</code>&nbsp;instead.</p>



<p><strong>3. Skipping the unit and getting unexpected results</strong></p>



<p>If you&#8217;re adding months but forget the unit:</p>



<pre class="wp-block-preformatted">DateAdd(Today(), 3) // This adds 3 DAYS, not months</pre>



<p>Always specify the unit to be safe and explicit.</p>



<p><strong>4. Time zone issues with SharePoint data</strong></p>



<p>If your filtered gallery is showing records off by a day, or timestamps look wrong, it&#8217;s almost always a UTC vs. local time issue. Use the&nbsp;<code>TimeZoneOffset()</code>&nbsp;conversion pattern I showed above.</p>



<p><strong>5. Nesting more than two DateAdd calls</strong></p>



<p>Nesting two DateAdd calls is fine. Beyond that, it gets hard to read and debug. Break it into variables instead:</p>



<pre class="wp-block-preformatted">Set(varStep1, DateAdd(Today(), 3, TimeUnit.Months));<br>Set(varStep2, DateAdd(varStep1, 15, TimeUnit.Days));<br>Set(varFinal, DateAdd(varStep2, 6, TimeUnit.Hours));</pre>



<p>Much easier to follow.</p>



<h2 class="wp-block-heading" id="power-apps-dateadd-quick-reference-cheat-sheet">Power Apps DateAdd Quick Reference Cheat Sheet</h2>



<p>Bookmark this table for quick lookups:</p>



<figure class="wp-block-table is-style-stripes"><table class="has-fixed-layout"><thead><tr><th>What You Want to Do</th><th>DateAdd Formula</th></tr></thead><tbody><tr><td>Add 7 days to today</td><td><code>DateAdd(Today(), 7, TimeUnit.Days)</code></td></tr><tr><td>Add 1 month to today</td><td><code>DateAdd(Today(), 1, TimeUnit.Months)</code></td></tr><tr><td>Add 1 year to a date</td><td><code>DateAdd(YourDate, 1, TimeUnit.Years)</code></td></tr><tr><td>Subtract 30 days from today</td><td><code>DateAdd(Today(), -30, TimeUnit.Days)</code></td></tr><tr><td>Go back 3 months</td><td><code>DateAdd(Today(), -3, TimeUnit.Months)</code></td></tr><tr><td>Add 2 hours to now</td><td><code>DateAdd(Now(), 2, TimeUnit.Hours)</code></td></tr><tr><td>Add 45 minutes to now</td><td><code>DateAdd(Now(), 45, TimeUnit.Minutes)</code></td></tr><tr><td>UTC to local time</td><td><code>DateAdd(UTCDate, -TimeZoneOffset(), TimeUnit.Minutes)</code></td></tr><tr><td>Local to UTC</td><td><code>DateAdd(Now(), TimeZoneOffset(), TimeUnit.Minutes)</code></td></tr><tr><td>Add months + days together</td><td><code>DateAdd(DateAdd(Today(), 2, TimeUnit.Months), 10, TimeUnit.Days)</code></td></tr><tr><td>Format result as text</td><td><code>Text(DateAdd(Today(), 30, TimeUnit.Days), "mmmm dd, yyyy")</code></td></tr></tbody></table></figure>



<h2 class="wp-block-heading" id="final-thoughts">Final Thoughts</h2>



<p>I hope you found this article helpful. In this guide, I explained how to use the DateAdd function in Power Apps. I also shared simple examples to add or subtract dates. These examples make it easy to understand date calculations.</p>



<p>If you are building apps, you will use date logic often. DateAdd makes it easy to handle dates. Try the examples in your app and experiment with different values. With practice, it will become easy to use.</p>



<p>Also, you may like:</p>



<ul class="wp-block-list">
<li><a href="https://www.spguides.com/power-apps-calculate/">Power Apps DateDiff() Function</a></li>



<li><a href="https://www.spguides.com/update-and-updateif-in-power-apps/">Update and UpdateIf in Power Apps</a></li>



<li><a href="https://www.spguides.com/power-apps-calculate-days-between-dates/">Calculate Days Between Dates in Power Apps</a></li>



<li><a href="https://www.spguides.com/show-repeating-table-data-from-sharepoint-list-in-power-apps/">Show Repeating Table Data From SharePoint List in Power Apps</a></li>
</ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Extract Data from PDF Invoices Automatically Using Power Automate</title>
		<link>https://www.spguides.com/extract-data-from-pdf-invoices-automatically-using-power-automate/</link>
		
		<dc:creator><![CDATA[Bijay Kumar]]></dc:creator>
		<pubDate>Wed, 29 Apr 2026 11:00:00 +0000</pubDate>
				<category><![CDATA[Power Automate]]></category>
		<category><![CDATA[Extract Data from PDF Invoices Automatically Using Power Automate]]></category>
		<guid isPermaLink="false">https://www.spguides.com/?p=134436</guid>

					<description><![CDATA[Recently, I was working with a client who was facing an issue in their invoice processing workflow. They were receiving a large number of invoices every day in PDF format, and their team had to manually open each file, read the details, and enter the data into SharePoint. It was taking a long time, and ... <a title="How to Extract Data from PDF Invoices Automatically Using Power Automate" class="read-more" href="https://www.spguides.com/extract-data-from-pdf-invoices-automatically-using-power-automate/" aria-label="Read more about How to Extract Data from PDF Invoices Automatically Using Power Automate">read more...</a>]]></description>
										<content:encoded><![CDATA[
<p>Recently, I was working with a client who was facing an issue in their invoice processing workflow. They were receiving a large number of invoices every day in PDF format, and their team had to manually open each file, read the details, and enter the data into SharePoint.</p>



<p>It was taking a long time, and even with careful work, small errors still occurred, such as incorrect amounts, missed dates, or incomplete entries. As volume increased, it became clear that this manual process was unsustainable.</p>



<p>That’s when I suggested building a simple automation using <a href="https://www.spguides.com/merge-pdf-files-in-power-automate/">Power Automate</a> and <a href="https://www.spguides.com/detect-text-in-dataverse-using-ai-builder/">AI</a>. Instead of handling invoices manually, we created a solution that lets users upload invoices as PDFs to a SharePoint library.</p>



<p>From there, the flow runs automatically, reads the invoice using AI, extracts all the important details, and stores them in a structured SharePoint list.</p>



<h2 class="wp-block-heading">Extract Data from PDF Invoices Automatically Using Power Automate</h2>



<p><strong>What We Are Building</strong></p>



<p>Here’s the full flow in simple terms:</p>



<ol class="wp-block-list">
<li>User uploads an invoice PDF to the SharePoint Document Library</li>



<li>Power Automate triggers automatically</li>



<li>The file content is sent to AI</li>



<li>AI extracts structured invoice data</li>



<li>Data is stored in a SharePoint list</li>
</ol>



<p>We are not using the default invoice model. Instead, we are using a custom AI prompt, which gives you more flexibility and control.</p>



<h3 class="wp-block-heading">Create a SharePoint Document Library</h3>



<p>Create a <a href="https://www.spguides.com/sharepoint-document-library-best-practices/">SharePoint document library</a> where users will upload invoices.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f9fafa" data-has-transparency="false" style="--dominant-color: #f9fafa;" loading="lazy" decoding="async" width="995" height="283" sizes="(max-width: 995px) 100vw, 995px" src="https://www.spguides.com/wp-content/uploads/2026/04/How-to-Extract-Data-from-PDF-with-Power-Automate.avif" alt="How to Extract Data from PDF with Power Automate" class="wp-image-134437 not-transparent" title="How to Extract Data from PDF with Power Automate" srcset="https://www.spguides.com/wp-content/uploads/2026/04/How-to-Extract-Data-from-PDF-with-Power-Automate.avif 995w, https://www.spguides.com/wp-content/uploads/2026/04/How-to-Extract-Data-from-PDF-with-Power-Automate-300x85.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/How-to-Extract-Data-from-PDF-with-Power-Automate-768x218.avif 768w" /></figure></div>


<h3 class="wp-block-heading">Create a SharePoint List for Extracted Data</h3>



<p>Create a <a href="https://www.spguides.com/power-apps-dataverse-vs-sharepoint-list/">SharePoint list</a> to store all extracted data.</p>



<p><a href="https://www.spguides.com/wp-content/uploads/2026/04/Column-Name.xlsx">Add These Columns</a>:</p>



<blockquote class="wp-block-quote has-contrast-2-background-color has-background is-layout-flow wp-block-quote-is-layout-flow">
<p class="has-base-3-color has-text-color has-link-color wp-elements-6d00e6611705e34ef583cb7c4c8756aa">Note:</p>



<p class="has-base-2-background-color has-background">When I was building this solution, I didn’t just randomly add columns. I looked at the invoice format the client was using and then designed the SharePoint list based on that structure. The idea was simple whatever information exists in the invoice should have a proper place in SharePoint so that we don’t lose any important data.</p>



<p class="has-base-2-background-color has-background">You can follow the same approach. Your columns should always be based on your invoice format. If your invoices have different fields, you can adjust accordingly.</p>
</blockquote>



<figure class="wp-block-table is-style-stripes"><table class="has-fixed-layout"><tbody><tr><td>Title (Invoice Number)</td><td>Single line</td></tr><tr><td>Invoice Date</td><td>Date</td></tr><tr><td>Due Date</td><td>Date</td></tr><tr><td>Vendor Name</td><td>Single line</td></tr><tr><td>Vendor Address</td><td>Multiple lines</td></tr><tr><td>Customer Name</td><td>Single line</td></tr><tr><td>Customer Address</td><td>Multiple lines</td></tr><tr><td>Subtotal</td><td>Single line</td></tr><tr><td>Tax Amount</td><td>Single line</td></tr><tr><td>Tax Percentage</td><td>Single line</td></tr><tr><td>Total Amount</td><td>Single line</td></tr><tr><td>Currency</td><td>Single line</td></tr><tr><td>Line Items</td><td>Multiple lines</td></tr><tr><td>Item Count</td><td>Single line</td></tr><tr><td>Bank Name</td><td>Single line</td></tr><tr><td>Account Number</td><td>Single line</td></tr><tr><td>IFSC Code</td><td>Single line</td></tr><tr><td>UPI ID</td><td>Single line</td></tr><tr><td>File Name</td><td>Single line</td></tr><tr><td>File Link</td><td>Hyperlink</td></tr><tr><td>Processed Date</td><td>Date</td></tr><tr><td>Status</td><td>Choice ( Processed, Failed)</td></tr></tbody></table></figure>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f9f9f9" data-has-transparency="false" style="--dominant-color: #f9f9f9;" loading="lazy" decoding="async" width="1024" height="136" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/How-To-Extract-Data-From-a-PDF-With-Power-Automate-1024x136.avif" alt="How To Extract Data From a PDF With Power Automate" class="wp-image-134439 not-transparent" title="How To Extract Data From a PDF With Power Automate" srcset="https://www.spguides.com/wp-content/uploads/2026/04/How-To-Extract-Data-From-a-PDF-With-Power-Automate-1024x136.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/How-To-Extract-Data-From-a-PDF-With-Power-Automate-300x40.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/How-To-Extract-Data-From-a-PDF-With-Power-Automate-768x102.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/How-To-Extract-Data-From-a-PDF-With-Power-Automate-1536x205.avif 1536w, https://www.spguides.com/wp-content/uploads/2026/04/How-To-Extract-Data-From-a-PDF-With-Power-Automate.avif 1547w" /></figure></div>


<h3 class="wp-block-heading">Create Extract Data from PDF Invoices Flow</h3>



<p>Now that our SharePoint library and list are ready, let’s build the actual flow. This is where everything comes together.</p>



<p>The idea is simple: as soon as a file is uploaded, the flow should pick it up, read it using AI, extract the data, and store it in your SharePoint list.</p>



<h4 class="wp-block-heading">Step 1: Create a New Flow</h4>



<ol class="wp-block-list">
<li>Go to <a href="https://make.powerautomate.com/" target="_blank" rel="noopener">Power Automate</a> and create a new automated cloud flow.</li>



<li>Choose the trigger: <a href="https://www.spguides.com/power-automate-copy-file-when-a-file-is-created-or-modified-in-sharepoint/">When a file is created</a> (properties only)</li>



<li>Then configure:
<ul class="wp-block-list">
<li>Site Address → Your SharePoint site</li>



<li>Library Name → Your Invoice Document Library</li>
</ul>
</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f7f8f8" data-has-transparency="false" style="--dominant-color: #f7f8f8;" loading="lazy" decoding="async" width="1024" height="327" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/Power-Automate-Flow-Reads-Invoices-with-AI-1024x327.avif" alt="Power Automate Flow Reads Invoices with AI" class="wp-image-134440 not-transparent" title="Power Automate Flow Reads Invoices with AI" srcset="https://www.spguides.com/wp-content/uploads/2026/04/Power-Automate-Flow-Reads-Invoices-with-AI-1024x327.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/Power-Automate-Flow-Reads-Invoices-with-AI-300x96.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/Power-Automate-Flow-Reads-Invoices-with-AI-768x245.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/Power-Automate-Flow-Reads-Invoices-with-AI.avif 1069w" /></figure></div>


<p>This ensures the flow runs automatically whenever a new invoice is uploaded.</p>



<h4 class="wp-block-heading">Step 2: Get File Content</h4>



<ol class="wp-block-list">
<li>Add action: <a href="https://www.spguides.com/merge-pdf-files-in-power-automate/">Get file content</a></li>



<li>Then configure:
<ul class="wp-block-list">
<li>Site Address → Your <a href="https://www.spguides.com/check-if-sharepoint-site-already-exists-in-power-automate/">SharePoint site</a></li>



<li>File Identifier → Select <strong>Identifier</strong> from the trigger</li>
</ul>
</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f8f8f8" data-has-transparency="false" style="--dominant-color: #f8f8f8;" loading="lazy" decoding="async" width="1024" height="365" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/How-to-use-Power-Automate-with-AI-to-extract-data-from-a-PDF-1024x365.avif" alt="How to use Power Automate with AI to extract data from a PDF" class="wp-image-134441 not-transparent" title="How to use Power Automate with AI to extract data from a PDF" srcset="https://www.spguides.com/wp-content/uploads/2026/04/How-to-use-Power-Automate-with-AI-to-extract-data-from-a-PDF-1024x365.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/How-to-use-Power-Automate-with-AI-to-extract-data-from-a-PDF-300x107.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/How-to-use-Power-Automate-with-AI-to-extract-data-from-a-PDF-768x274.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/How-to-use-Power-Automate-with-AI-to-extract-data-from-a-PDF.avif 1086w" /></figure></div>


<p>This step is very important. The trigger only returns file metadata (like name and path), but the AI needs the actual file to read the invoice.</p>



<h4 class="wp-block-heading">Step 3: Run a Custom AI Prompt</h4>



<p>Now we move to the core logic.</p>



<ol class="wp-block-list">
<li>Add action: <a href="https://www.spguides.com/convert-invoice-details-to-excel-ai-builder-power-automate/">Run a prompt</a></li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f8f9fa" data-has-transparency="false" style="--dominant-color: #f8f9fa;" loading="lazy" decoding="async" width="1024" height="250" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/Power-Automate-PDF-Extraction-and-Application-Entry-1024x250.avif" alt="Power Automate PDF Extraction and Application Entry" class="wp-image-134442 not-transparent" title="Power Automate PDF Extraction and Application Entry" srcset="https://www.spguides.com/wp-content/uploads/2026/04/Power-Automate-PDF-Extraction-and-Application-Entry-1024x250.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/Power-Automate-PDF-Extraction-and-Application-Entry-300x73.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/Power-Automate-PDF-Extraction-and-Application-Entry-768x188.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/Power-Automate-PDF-Extraction-and-Application-Entry.avif 1105w" /></figure></div>


<ol start="2" class="wp-block-list">
<li>Expand the prompt and select + New custom prompt.</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f7f8f8" data-has-transparency="false" style="--dominant-color: #f7f8f8;" loading="lazy" decoding="async" width="1024" height="272" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/Extract-PDF-Invoice-with-Text-Manipulation-in-Microsoft-Power-Automate-1024x272.avif" alt="Extract PDF Invoice with Text Manipulation in Microsoft Power Automate" class="wp-image-134443 not-transparent" title="Extract PDF Invoice with Text Manipulation in Microsoft Power Automate" srcset="https://www.spguides.com/wp-content/uploads/2026/04/Extract-PDF-Invoice-with-Text-Manipulation-in-Microsoft-Power-Automate-1024x272.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/Extract-PDF-Invoice-with-Text-Manipulation-in-Microsoft-Power-Automate-300x80.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/Extract-PDF-Invoice-with-Text-Manipulation-in-Microsoft-Power-Automate-768x204.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/Extract-PDF-Invoice-with-Text-Manipulation-in-Microsoft-Power-Automate.avif 1100w" /></figure></div>


<ol start="3" class="wp-block-list">
<li>Then, under the instructions, add the following instruction:</li>



<li>Also, add an input parameter like: Document Content</li>
</ol>



<pre class="wp-block-code"><code>You are an AI that extracts structured data from invoice documents.

Extract the following fields from the invoice:

- Invoice Number
- Invoice Date
- Due Date
- Vendor Name
- Vendor Address
- Customer Name
- Customer Address
- Subtotal
- Tax Amount
- Tax Percentage
- Total Amount
- Currency
- Bank Name
- Account Number
- IFSC Code
- UPI ID
- Line Items (Description, Quantity, Rate, Amount)
- Item Count (total number of line items)

Rules:
- Return ONLY valid JSON (no explanation).
- If any value is missing, return an empty string "".
- Dates should be in YYYY-MM-DD format.
- Numbers should not contain commas.

Output format:

{
  "InvoiceNumber": "",
  "InvoiceDate": "",
  "DueDate": "",
  "VendorName": "",
  "VendorAddress": "",
  "CustomerName": "",
  "CustomerAddress": "",
  "Subtotal": "",
  "TaxAmount": "",
  "TaxPercentage": "",
  "TotalAmount": "",
  "Currency": "",
  "BankName": "",
  "AccountNumber": "",
  "IFSCCode": "",
  "UPIID": "",
  "ItemCount": "",
  "LineItems": &#91;
    {
      "Description": "",
      "Quantity": "",
      "Rate": "",
      "Amount": ""
    }
  ]
}</code></pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f9fafb" data-has-transparency="false" style="--dominant-color: #f9fafb;" loading="lazy" decoding="async" width="926" height="623" sizes="(max-width: 926px) 100vw, 926px" src="https://www.spguides.com/wp-content/uploads/2026/04/Extract-from-PDFs-made-EASY-using-Prompts-with-Power-Automate.avif" alt="Extract from PDFs made EASY using Prompts with Power Automate" class="wp-image-134444 not-transparent" title="Extract from PDFs made EASY using Prompts with Power Automate" srcset="https://www.spguides.com/wp-content/uploads/2026/04/Extract-from-PDFs-made-EASY-using-Prompts-with-Power-Automate.avif 926w, https://www.spguides.com/wp-content/uploads/2026/04/Extract-from-PDFs-made-EASY-using-Prompts-with-Power-Automate-300x202.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/Extract-from-PDFs-made-EASY-using-Prompts-with-Power-Automate-768x517.avif 768w" /></figure></div>


<ol start="5" class="wp-block-list">
<li>On the right side (Model response settings): Set Output type → JSON</li>



<li>Also, rename the prompt to something meaningful, like: Extract Invoice</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f7f7fb" data-has-transparency="false" style="--dominant-color: #f7f7fb;" loading="lazy" decoding="async" width="1024" height="449" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/Extract-PDF-data-using-Power-Automate-1024x449.avif" alt="Extract PDF data using Power Automate" class="wp-image-134445 not-transparent" title="Extract PDF data using Power Automate" srcset="https://www.spguides.com/wp-content/uploads/2026/04/Extract-PDF-data-using-Power-Automate-1024x449.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/Extract-PDF-data-using-Power-Automate-300x132.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/Extract-PDF-data-using-Power-Automate-768x337.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/Extract-PDF-data-using-Power-Automate-1536x673.avif 1536w, https://www.spguides.com/wp-content/uploads/2026/04/Extract-PDF-data-using-Power-Automate.avif 1891w" /></figure></div>


<p>Now that your prompt is configured, it’s time to test. Upload one of your sample invoice PDFs to the Document input. Check the Model response side, it is giving the correct json.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f5f6f8" data-has-transparency="false" style="--dominant-color: #f5f6f8;" loading="lazy" decoding="async" width="1024" height="422" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/Power-Automate-OCR-Extract-PDF-Data-Made-Simple-1024x422.avif" alt="Power Automate OCR Extract PDF Data Made Simple" class="wp-image-134446 not-transparent" title="Power Automate OCR Extract PDF Data Made Simple" srcset="https://www.spguides.com/wp-content/uploads/2026/04/Power-Automate-OCR-Extract-PDF-Data-Made-Simple-1024x422.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/Power-Automate-OCR-Extract-PDF-Data-Made-Simple-300x124.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/Power-Automate-OCR-Extract-PDF-Data-Made-Simple-768x316.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/Power-Automate-OCR-Extract-PDF-Data-Made-Simple-1536x632.avif 1536w, https://www.spguides.com/wp-content/uploads/2026/04/Power-Automate-OCR-Extract-PDF-Data-Made-Simple.avif 1955w" /></figure></div>


<ol start="7" class="wp-block-list">
<li>Then, in the <strong>Run a prompt</strong> action, select the prompt you created (for example, <strong>Extract Invoice</strong>).</li>
</ol>



<p>After that, you need to pass the input file to the AI so it can read the invoice.</p>



<ol start="8" class="wp-block-list">
<li>In the <strong>Document input</strong>, select:
<ul class="wp-block-list">
<li><strong>File Content</strong> from the previous <strong>Get file content</strong> action</li>
</ul>
</li>
</ol>



<pre class="wp-block-code"><code>base64(body('Get_file_content'))</code></pre>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f7f8f9" data-has-transparency="false" style="--dominant-color: #f7f8f9;" loading="lazy" decoding="async" width="1024" height="396" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/Get-Data-from-PDF-using-Power-Automate-1024x396.avif" alt="Get Data from PDF using Power Automate" class="wp-image-134447 not-transparent" title="Get Data from PDF using Power Automate" srcset="https://www.spguides.com/wp-content/uploads/2026/04/Get-Data-from-PDF-using-Power-Automate-1024x396.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/Get-Data-from-PDF-using-Power-Automate-300x116.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/Get-Data-from-PDF-using-Power-Automate-768x297.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/Get-Data-from-PDF-using-Power-Automate.avif 1067w" /></figure></div>


<p>This step is very important. Without passing the file content, the prompt won’t have anything to process, and you won’t get any output.</p>



<p>Once this is set, the AI will take the PDF file, read the invoice details, and return the structured JSON based on your prompt.</p>



<h4 class="wp-block-heading">Step 4: Create an Item in SharePoint</h4>



<p>Now that our AI prompt is working and returning clean JSON, the next step is to store that data in our SharePoint list.</p>



<ol class="wp-block-list">
<li>Add a new action: <a href="https://www.spguides.com/create-sharepoint-list-item-using-copilot-studio/">Create item</a></li>



<li>Then configure:
<ul class="wp-block-list">
<li><strong>Site Address</strong> → Your SharePoint site</li>



<li><strong>List Name</strong> → Extracted Invoice Data</li>
</ul>
</li>
</ol>



<p>Map the Fields</p>



<p>Now you need to map the output from the <strong>Run a prompt</strong> action to our SharePoint columns. Since your prompt is already returning structured JSON, you can directly use those values.</p>



<p>Map like this:</p>



<ul class="wp-block-list">
<li><strong>Title</strong> → InvoiceNumber</li>



<li><strong>Invoice Date</strong> → InvoiceDate</li>



<li><strong>Due Date</strong> → DueDate</li>



<li><strong>Vendor Name</strong> → VendorName</li>



<li><strong>Vendor Address</strong> → VendorAddress</li>



<li><strong>Customer Name</strong> → CustomerName</li>



<li><strong>Customer Address</strong> → CustomerAddress</li>



<li><strong>Subtotal</strong> → Subtotal</li>



<li><strong>Tax Amount</strong> → TaxAmount</li>



<li><strong>Tax Percentage</strong> → TaxPercentage</li>



<li><strong>Total Amount</strong> → TotalAmount</li>



<li><strong>Currency</strong> → Currency</li>



<li><strong>Bank Name</strong> → BankName</li>



<li><strong>Account Number</strong> → AccountNumber</li>



<li><strong>IFSC Code</strong> → IFSCCode</li>



<li><strong>UPI ID</strong> → UPIID</li>



<li><strong>Item Count</strong> → ItemCount</li>



<li><strong>Line Items</strong> → LineItems</li>
</ul>



<p><strong>Handle Line Items</strong></p>



<p>For the Line Items column (multiple lines), you need to convert the array into a string.</p>



<p>Use this expression:</p>



<pre class="wp-block-preformatted">string(body('Run_a_prompt')?['LineItems'])</pre>



<p>This will store all the extracted line items in JSON format inside SharePoint.</p>



<p>Now map the additional tracking columns:</p>



<ul class="wp-block-list">
<li><strong>File Name</strong> → File Name (from trigger)</li>



<li><strong>File Link</strong> → Link to item or file path</li>



<li><strong>Processed Date</strong> → use utcNow()</li>



<li><strong>Status</strong> → Processed</li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f7f8f9" data-has-transparency="false" style="--dominant-color: #f7f8f9;" loading="lazy" decoding="async" width="335" height="1024" sizes="(max-width: 335px) 100vw, 335px" src="https://www.spguides.com/wp-content/uploads/2026/04/Extract-Data-from-Invoices-using-a-Document-Processing-In-Power-Autoamte-335x1024.avif" alt="Extract Data from Invoices using a Document Processing In Power Automate" class="wp-image-134448 not-transparent" title="Extract Data from Invoices using a Document Processing In Power Autoamte" srcset="https://www.spguides.com/wp-content/uploads/2026/04/Extract-Data-from-Invoices-using-a-Document-Processing-In-Power-Autoamte-335x1024.avif 335w, https://www.spguides.com/wp-content/uploads/2026/04/Extract-Data-from-Invoices-using-a-Document-Processing-In-Power-Autoamte-98x300.avif 98w, https://www.spguides.com/wp-content/uploads/2026/04/Extract-Data-from-Invoices-using-a-Document-Processing-In-Power-Autoamte-503x1536.avif 503w, https://www.spguides.com/wp-content/uploads/2026/04/Extract-Data-from-Invoices-using-a-Document-Processing-In-Power-Autoamte.avif 752w" /></figure></div>


<h3 class="wp-block-heading">Testing the Complete Flow</h3>



<p>Now that everything is set up, it’s time to test your flow end-to-end.</p>



<p>Upload one of your sample invoice PDF files to the SharePoint document library.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f9f9f9" data-has-transparency="false" style="--dominant-color: #f9f9f9;" loading="lazy" decoding="async" width="974" height="295" sizes="(max-width: 974px) 100vw, 974px" src="https://www.spguides.com/wp-content/uploads/2026/04/Extract-Data-from-PDFs-with-Power-Automate.avif" alt="Extract Data from PDFs with Power Automate" class="wp-image-134449 not-transparent" title="Extract Data from PDFs with Power Automate" srcset="https://www.spguides.com/wp-content/uploads/2026/04/Extract-Data-from-PDFs-with-Power-Automate.avif 974w, https://www.spguides.com/wp-content/uploads/2026/04/Extract-Data-from-PDFs-with-Power-Automate-300x91.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/Extract-Data-from-PDFs-with-Power-Automate-768x233.avif 768w" /></figure></div>


<p>As soon as the file is uploaded, our flow should trigger automatically.</p>



<h4 class="wp-block-heading">Verify the Flow Run</h4>



<p>Go to <strong>Power Automate → Flow Runs</strong> and open the latest run.</p>



<p>Check each step one by one:</p>



<ul class="wp-block-list">
<li><strong>Trigger</strong> → Confirm the file is picked correctly</li>



<li><strong>Get file content</strong> → Ensure file content is retrieved</li>



<li><strong>Run a prompt</strong> → This is the most important step</li>
</ul>



<p>Open the output of <strong>Run a prompt</strong> and verify:</p>



<ul class="wp-block-list">
<li>JSON is valid</li>



<li>All fields are present</li>



<li>Values are correctly extracted</li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f5f6f5" data-has-transparency="false" style="--dominant-color: #f5f6f5;" loading="lazy" decoding="async" width="1024" height="741" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/PDF-Data-Extraction-using-AI-Builder-Power-Automate-1024x741.avif" alt="PDF Data Extraction using AI Builder Power Automate" class="wp-image-134450 not-transparent" title="PDF Data Extraction using AI Builder Power Automate" srcset="https://www.spguides.com/wp-content/uploads/2026/04/PDF-Data-Extraction-using-AI-Builder-Power-Automate-1024x741.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/PDF-Data-Extraction-using-AI-Builder-Power-Automate-300x217.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/PDF-Data-Extraction-using-AI-Builder-Power-Automate-768x556.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/PDF-Data-Extraction-using-AI-Builder-Power-Automate.avif 1092w" /></figure></div>


<h4 class="wp-block-heading">Check SharePoint List</h4>



<p>Now go to your <strong>Extracted Invoice Data</strong> list.</p>



<p>You should see a new item created with:</p>



<ul class="wp-block-list">
<li>Invoice Number</li>



<li>Vendor Name</li>



<li>Dates</li>



<li>Amounts</li>



<li>Line Items</li>



<li>File details</li>
</ul>



<figure class="wp-block-image size-large"><img data-dominant-color="fafaf8" data-has-transparency="false" style="--dominant-color: #fafaf8;" loading="lazy" decoding="async" width="1536" height="454" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/How-to-Extract-Data-from-PDF-Invoices-Automatically-Using-Power-Automate.gif" alt="How to Extract Data from PDF Invoices Automatically Using Power Automate" class="wp-image-134451 not-transparent" title="How to Extract Data from PDF Invoices Automatically Using Power Automate"></figure>



<p>Everything should be populated automatically.</p>



<h3 class="wp-block-heading">What If Something Is Not Working?</h3>



<p>If data is incorrect or missing:</p>



<ul class="wp-block-list">
<li>Go back to the <strong>Run a prompt</strong> step</li>



<li>Improve your prompt instructions</li>



<li>Test again</li>
</ul>



<p>Do not rush to change the flow logic. Most of the time, the issue is with how the prompt is written.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p>In this tutorial, I covered a complete end-to-end solution to automate invoice processing.</p>



<p>We started with a real problem where invoices were handled manually. Then we built a solution using Power Automate and AI.</p>



<p>I created a SharePoint document library to upload invoices and a SharePoint list to store extracted data. After that, we built the flow step by step, triggering when a file is uploaded, getting the file content, using a custom AI prompt to extract data, and finally storing that data in SharePoint.</p>



<p>We also tested the flow to make sure everything is working correctly.</p>



<p>That’s it. You now have a working solution that can automatically read invoice PDFs and store the data without any manual effort.</p>



<p>You may also like:</p>



<ul class="wp-block-list">
<li><a href="https://www.spguides.com/save-my-email-attachments-to-a-sharepoint-document-library/">Power Automate saves email attachment to SharePoint</a></li>



<li><a href="https://www.spguides.com/microsoft-flow-delete-all-files-in-a-folder/">Delete all files in a SharePoint folder using Power Automate</a></li>



<li><a href="https://www.spguides.com/power-automate-send-approval-to-microsoft-365-group/">Send an Approval to a Microsoft 365 Group in Power Automate</a></li>



<li><a href="https://www.spguides.com/power-automate-send-approval-to-sharepoint-group-members/">Send Approval to SharePoint Group Members Using Power Automate</a></li>



<li><a href="https://www.spguides.com/microsoft-flow-copy-list-items-to-another-list/">Copy List Items To Another List In SharePoint Using Power Automate</a></li>
</ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Migrate from Gulp based to Heft based Toolchain in SharePoint Framework (SPFx)</title>
		<link>https://www.spguides.com/migrate-gulp-to-heft-in-spfx/</link>
		
		<dc:creator><![CDATA[Bijay Kumar]]></dc:creator>
		<pubDate>Tue, 28 Apr 2026 16:34:21 +0000</pubDate>
				<category><![CDATA[SharePoint Framework]]></category>
		<category><![CDATA[Migrate from Gulp based to Heft based Toolchain in SPFx]]></category>
		<guid isPermaLink="false">https://www.spguides.com/?p=132844</guid>

					<description><![CDATA[If you&#8217;ve been building SharePoint Framework solutions for a while, you already know Gulp. It&#8217;s been the backbone of every SPFx project since day one — running your builds, serving the workbench, packaging your&#160;.sppkg&#160;files. But that era is officially over. With&#160;SPFx v1.22, Microsoft replaced the Gulp-based toolchain with&#160;Heft&#160;— a config-driven build orchestrator from the Rush ... <a title="Migrate from Gulp based to Heft based Toolchain in SharePoint Framework (SPFx)" class="read-more" href="https://www.spguides.com/migrate-gulp-to-heft-in-spfx/" aria-label="Read more about Migrate from Gulp based to Heft based Toolchain in SharePoint Framework (SPFx)">read more...</a>]]></description>
										<content:encoded><![CDATA[
<p>If you&#8217;ve been <a href="https://www.spguides.com/spfx-training-course/" target="_blank" rel="noreferrer noopener">building SharePoint Framework solutions</a> for a while, you already know Gulp. It&#8217;s been the backbone of every SPFx project since day one — running your builds, serving the workbench, packaging your&nbsp;<code>.sppkg</code>&nbsp;files. But that era is officially over.</p>



<p>With&nbsp;<strong>SPFx v1.22</strong>, Microsoft replaced the Gulp-based toolchain with&nbsp;<strong>Heft</strong>&nbsp;— a config-driven build orchestrator from the Rush Stack ecosystem. Starting with SPFx v1.23, all new projects will use Heft by default. And by v1.24, the Gulp-based pipeline will be officially unsupported.</p>



<p>So if you have existing projects still running on Gulp, now is the time to migrate. In this tutorial, I will explain how to <strong>migrate from a Gulp-based to a Heft-based toolchain in the SharePoint Framework (SPFx)</strong> step by step.</p>



<h2 class="wp-block-heading">What is Heft in SharePoint Framework?</h2>



<p>In&nbsp;<strong>SPFx (SharePoint Framework)</strong>,&nbsp;<strong>Heft</strong>&nbsp;is basically a&nbsp;<strong>build and task management tool</strong>&nbsp;that helps run and organize all the behind-the-scenes processes when you develop a SharePoint solution.</p>



<p>Think of Heft as a&nbsp;<strong>modern replacement for older tools like Gulp</strong>&nbsp;in SPFx. Starting from SPFx v1.22, Microsoft officially switched from Gulp to Heft to make builds cleaner and faster.</p>



<p>When you&#8217;re building an SPFx project, a lot of things need to happen automatically:</p>



<ul class="wp-block-list">
<li>Compile&nbsp;<strong>TypeScript → JavaScript</strong></li>



<li><strong>Bundle</strong>&nbsp;your code</li>



<li>Run&nbsp;<strong>linting</strong>&nbsp;(check code quality)</li>



<li>Execute&nbsp;<strong>tests</strong></li>



<li>Build the&nbsp;<strong>final package</strong>&nbsp;ready for SharePoint</li>
</ul>



<p><strong>Heft handles all of this automatically</strong>&nbsp;— you just run one command like&nbsp;<code>heft build</code>&nbsp;or&nbsp;<code>heft start</code>, and it takes care of the rest behind the scenes.</p>



<p>Instead of writing custom task scripts like you used to with Gulp, Heft uses simple&nbsp;<strong>JSON configuration files</strong>&nbsp;to define what to do, making your project easier to maintain and understand.</p>



<p>A new SPFx project already comes&nbsp;<strong>pre-configured with Heft</strong>&nbsp;through something called a&nbsp;<strong>rig</strong>&nbsp;(a shared settings package). So you don&#8217;t need to set anything up yourself — it just works out of the box.</p>



<p>Here&#8217;s a quick comparison between Gulp and Heft.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Area</th><th>Gulp (Legacy)</th><th>Heft (SPFx v1.22+)</th></tr></thead><tbody><tr><td>Core model</td><td>Custom JS tasks in&nbsp;<code>gulpfile.js</code></td><td>Config-driven with plugins and rigs</td></tr><tr><td>Extensibility</td><td>Write custom tasks per project</td><td>Use Heft plugins or patch files</td></tr><tr><td>Performance</td><td>Sequential tasks, no caching</td><td>Incremental builds and caching</td></tr><tr><td>Config location</td><td>Scattered across&nbsp;<code>gulpfile.js</code></td><td>Centralized JSON files (<code>heft.json</code>, etc.)</td></tr><tr><td>Scale</td><td>Hard to keep consistent across repos</td><td>Built to scale with Rush Stack monorepos</td></tr></tbody></table></figure>



<p>Heft makes SPFx development&nbsp;<strong>cleaner and more modern</strong>&nbsp;by replacing the old Gulp-based system with a structured, configuration-driven approach.</p>



<p>Check out <a href="https://www.spguides.com/set-up-spfx-project-with-heft/">Set Up Your SharePoint Framework (SPFx) Development Environment using Heft Toolchain</a></p>



<h2 class="wp-block-heading" id="before-you-start--a-few-things-to-check">Before You Start — A Few Things to Check</h2>



<p>Don&#8217;t jump straight to uninstalling packages. Do these first:</p>



<ul class="wp-block-list">
<li><strong>Back up your project.</strong>&nbsp;Either copy the folder or make sure all your code is committed to source control. The migration makes sweeping changes to your config files and&nbsp;<code>package.json</code>.</li>



<li><strong>Check your Node.js version.</strong>&nbsp;SPFx v1.22 requires Node v22. Run&nbsp;<code>node -v</code>&nbsp;to confirm. If you&#8217;re on an older version, update first.</li>



<li><strong>Check for gulp customizations.</strong>&nbsp;Open your&nbsp;<code>gulpfile.js</code>&nbsp;and look for any custom tasks — things like&nbsp;<code>build.configureWebpack.mergeConfig()</code>,&nbsp;<code>build.rig.addPreBuildTask()</code>, or custom copy/lint steps. You&#8217;ll need to translate these to Heft plugins after the migration. Note these down before you delete anything.</li>
</ul>



<h2 class="wp-block-heading">Migrate from Gulp based to Heft based Toolchain in SPFx</h2>



<p>Follow the steps below to migrate from Gulp based to Heft based Toolchain in SharePoint Framework (SPFx).</p>



<h3 class="wp-block-heading" id="step-1-uninstall-the-gulp-toolchain">Step 1: Uninstall the Gulp Toolchain</h3>



<p>The first thing to do is rip out the old <a href="https://www.spguides.com/no-gulpfile-found-spfx/" target="_blank" rel="noreferrer noopener">Gulp-based packages</a>. Run this command from your project root:</p>



<pre class="wp-block-preformatted">npm uninstall @microsoft/sp-build-web ajv gulp</pre>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="161515" data-has-transparency="false" style="--dominant-color: #161515;" loading="lazy" decoding="async" width="1024" height="452" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/uninstall-gulp-cli-1024x452.avif" alt="uninstall gulp-cli" class="wp-image-133914 not-transparent" title="uninstall gulp cli" srcset="https://www.spguides.com/wp-content/uploads/2026/04/uninstall-gulp-cli-1024x452.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/uninstall-gulp-cli-300x133.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/uninstall-gulp-cli-768x339.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/uninstall-gulp-cli.avif 1082w" /></figure></div>


<p>Next, uninstall the TypeScript compiler wrapper. The default SPFx v1.21.1 project uses TypeScript 5.3, so:</p>



<pre class="wp-block-preformatted">npm uninstall @microsoft/rush-stack-compiler-5.3</pre>



<p>If your project uses a different <a href="https://www.spguides.com/typescript-enums/">TypeScript</a> version, replace&nbsp;<code>5.3</code>&nbsp;with whatever version you have. Check your&nbsp;<code>package.json</code>&nbsp;devDependencies — look for&nbsp;<code>@microsoft/rush-stack-compiler-*</code>.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="161515" data-has-transparency="false" style="--dominant-color: #161515;" loading="lazy" decoding="async" width="1024" height="422" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/install-specific-version-of-gulp-1024x422.avif" alt="install specific version of gulp" class="wp-image-133917 not-transparent" title="install specific version of gulp" srcset="https://www.spguides.com/wp-content/uploads/2026/04/install-specific-version-of-gulp-1024x422.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/install-specific-version-of-gulp-300x124.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/install-specific-version-of-gulp-768x317.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/install-specific-version-of-gulp.avif 1082w" /></figure></div>


<h3 class="wp-block-heading" id="step-2-install-the-heft-toolchain">Step 2: Install the Heft Toolchain</h3>



<p>Now install all the Heft-related packages your project needs:</p>



<pre class="wp-block-preformatted">npm install @microsoft/spfx-web-build-rig@1.22.1 @microsoft/spfx-heft-plugins@1.22.1 @microsoft/eslint-config-spfx@1.22.1 @microsoft/eslint-plugin-spfx@1.22.1 @microsoft/sp-module-interfaces@1.22.1 @rushstack/eslint-config@4.5.2 @rushstack/heft@1.1.2 @types/heft-jest@1.0.2 @typescript-eslint/parser@8.46.2 --save-dev --save-exact --force</pre>



<p>That&nbsp;<code>--force</code>&nbsp;flag is there because some peer dependency conflicts can pop up during migration. It&#8217;s fine to use here — you&#8217;re intentionally replacing the old toolchain.</p>



<p>If you also want to upgrade TypeScript to v5.8 (optional but recommended), run:</p>



<pre class="wp-block-preformatted">npm install typescript@~5.8.0 --save-dev</pre>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="1c1a1a" data-has-transparency="false" style="--dominant-color: #1c1a1a;" loading="lazy" decoding="async" width="1024" height="294" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/spfx-gulp-migration-with-heft-1024x294.avif" alt="spfx gulp migration with heft" class="wp-image-133938 not-transparent" title="spfx gulp migration with heft" srcset="https://www.spguides.com/wp-content/uploads/2026/04/spfx-gulp-migration-with-heft-1024x294.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/spfx-gulp-migration-with-heft-300x86.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/spfx-gulp-migration-with-heft-768x221.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/spfx-gulp-migration-with-heft.avif 1266w" /></figure></div>


<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p><strong>Heads up:</strong>&nbsp;If you run into issues installing TypeScript v5.8 during migration, you can skip this for now. The toolchain works fine with TypeScript v5.3 too.</p>
</blockquote>



<h3 class="wp-block-heading" id="step-3-update-your-npm-scripts">Step 3: Update Your NPM Scripts</h3>



<p>Open your&nbsp;<code>package.json</code>&nbsp;and replace the old Gulp-based scripts with Heft equivalents. Find the&nbsp;<code>scripts</code>&nbsp;section and update it like this:</p>



<pre class="wp-block-preformatted">{<br>  "scripts": {<br>    "build": "heft build --clean",<br>    "clean": "heft clean",<br>    "test": "heft test",<br>    "test-only": "heft run --only test --",<br>    "deploy": "heft dev-deploy",<br>    "start": "heft start --clean",<br>    "build-watch": "heft build --lite",<br>    "package-solution": "heft package-solution",<br>    "deploy-azure-storage": "heft deploy-azure-storage",<br>    "eject-webpack": "heft eject-webpack",<br>    "trust-dev-cert": "heft trust-dev-cert",<br>    "untrust-dev-cert": "heft untrust-dev-cert"<br>  }<br>}<br></pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f3f0f1" data-has-transparency="false" style="--dominant-color: #f3f0f1;" loading="lazy" decoding="async" width="892" height="610" sizes="(max-width: 892px) 100vw, 892px" src="https://www.spguides.com/wp-content/uploads/2026/04/heft-configuration-in-spfx.avif" alt="heft configuration in spfx" class="wp-image-133920 not-transparent" title="heft configuration in" srcset="https://www.spguides.com/wp-content/uploads/2026/04/heft-configuration-in-spfx.avif 892w, https://www.spguides.com/wp-content/uploads/2026/04/heft-configuration-in-spfx-300x205.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/heft-configuration-in-spfx-768x525.avif 768w" /></figure></div>


<p>Here&#8217;s how the old Gulp commands map to Heft:</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Gulp command</th><th>Heft equivalent</th></tr></thead><tbody><tr><td><code>gulp serve</code></td><td><code>heft start</code></td></tr><tr><td><code>gulp build</code></td><td><code>heft build</code></td></tr><tr><td><code>gulp bundle --ship</code></td><td><code>heft build --production</code></td></tr><tr><td><code>gulp package-solution --ship</code></td><td><code>heft package-solution --production</code></td></tr><tr><td><code>gulp clean</code></td><td><code>heft clean</code></td></tr></tbody></table></figure>



<p>Read <a href="https://www.spguides.com/change-solution-name-in-spfx/">How to Change Solution Name in SPFx</a></p>



<h3 class="wp-block-heading" id="step-4-add-the-spfx-heft-rig">Step 4: Add the SPFx Heft Rig</h3>



<p>Heft uses a concept called&nbsp;<strong>rigs</strong>&nbsp;— shared build configurations that multiple projects can extend. This is what replaces the old&nbsp;<code>sp-build-web</code>&nbsp;rig from the Gulp days.</p>



<p>Create a new file at&nbsp;<code>./config/rig.json</code>&nbsp;with this content:</p>



<pre class="wp-block-preformatted">{<br>  "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",<br>  "rigPackageName": "@microsoft/spfx-web-build-rig"<br>}</pre>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f6f3f3" data-has-transparency="false" style="--dominant-color: #f6f3f3;" loading="lazy" decoding="async" width="1024" height="312" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/spfx-heft-commands-1024x312.avif" alt="spfx heft commands" class="wp-image-133922 not-transparent" title="spfx heft commands" srcset="https://www.spguides.com/wp-content/uploads/2026/04/spfx-heft-commands-1024x312.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/spfx-heft-commands-300x92.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/spfx-heft-commands-768x234.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/spfx-heft-commands.avif 1154w" /></figure></div>


<p>This one file tells Heft: &#8220;use the SPFx web build rig for all the default build settings.&#8221; You don&#8217;t have to define TypeScript paths, Webpack entry points, or ESLint configs from scratch — the rig handles all of that for you.</p>



<h3 class="wp-block-heading" id="step-5-replace-the-sass-configuration">Step 5: Replace the Sass Configuration</h3>



<p>Open&nbsp;<code>./config/sass.json</code>&nbsp;and replace everything in it with:</p>



<pre class="wp-block-preformatted">{<br>  "$schema": "https://developer.microsoft.com/json-schemas/heft/v0/heft-sass-plugin.schema.json",<br>  "extends": "@microsoft/spfx-web-build-rig/profiles/default/config/sass.json"<br>}<br></pre>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f6f3f3" data-has-transparency="false" style="--dominant-color: #f6f3f3;" loading="lazy" decoding="async" width="1024" height="281" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/heft-commands-in-spfx-1024x281.avif" alt="heft commands in spfx" class="wp-image-133926 not-transparent" title="heft commands in spfx" srcset="https://www.spguides.com/wp-content/uploads/2026/04/heft-commands-in-spfx-1024x281.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/heft-commands-in-spfx-300x82.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/heft-commands-in-spfx-768x210.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/heft-commands-in-spfx.avif 1270w" /></figure></div>


<p>This hooks your project&#8217;s Sass compilation into the Heft Sass plugin defined by the rig. If you had custom Sass settings in the old file (like&nbsp;<code>useCSSModules</code>&nbsp;or&nbsp;<code>postProcessedFileExtensions</code>), you can add those back here — they&#8217;ll override the rig&#8217;s defaults.</p>



<h3 class="wp-block-heading" id="step-6-add-the-typescript-plugin-configuration">Step 6: Add the TypeScript Plugin Configuration</h3>



<p>Create a new file at&nbsp;<code>./config/typescript.json</code>:</p>



<pre class="wp-block-preformatted">{<br>  "extends": "@microsoft/spfx-web-build-rig/profiles/default/config/typescript.json",<br>  "staticAssetsToCopy": {<br>    "fileExtensions": [".resx", ".jpg", ".png", ".woff", ".eot", ".ttf", ".svg", ".gif"],<br>    "includeGlobs": ["webparts/*/loc/*.js"]<br>  }<br>}</pre>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f5f2f3" data-has-transparency="false" style="--dominant-color: #f5f2f3;" loading="lazy" decoding="async" width="1024" height="311" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/sharepoint-framework-gulp-migration-1024x311.avif" alt="sharepoint framework gulp migration" class="wp-image-133928 not-transparent" title="sharepoint framework gulp migration" srcset="https://www.spguides.com/wp-content/uploads/2026/04/sharepoint-framework-gulp-migration-1024x311.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/sharepoint-framework-gulp-migration-300x91.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/sharepoint-framework-gulp-migration-768x234.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/sharepoint-framework-gulp-migration.avif 1184w" /></figure></div>


<p>The&nbsp;<code>staticAssetsToCopy</code>&nbsp;section tells Heft which non-TypeScript files to copy over during the build. This replaces what&nbsp;<code>gulp copy-assets</code>&nbsp;or similar custom tasks used to handle. Adjust the file extensions and globs to match whatever your project actually needs.</p>



<p>Check out <a href="https://www.spguides.com/install-nvm-in-windows/">How to Install NVM in Windows</a></p>



<h3 class="wp-block-heading" id="step-7-update-tsconfigjson">Step 7: Update tsconfig.json</h3>



<p>Replace the contents of your existing&nbsp;<code>./tsconfig.json</code>&nbsp;with this:</p>



<pre class="wp-block-preformatted">{<br>  "extends": "./node_modules/@microsoft/spfx-web-build-rig/profiles/default/tsconfig-base.json"<br>}</pre>



<p>Your old&nbsp;<code>tsconfig.json</code>&nbsp;probably had a long list of compiler options. All of those are now inherited from the rig&#8217;s base config. You only need to add project-specific overrides here if you have them.</p>



<h3 class="wp-block-heading" id="step-8-delete-gulpfilejs">Step 8: Delete gulpfile.js</h3>



<p>Just delete it.</p>



<pre class="wp-block-preformatted">rm gulpfile.js</pre>



<p>If you had custom tasks in your&nbsp;<code>gulpfile.js</code>&nbsp;— like custom Webpack config, pre-build steps, or post-build file operations —&nbsp;<strong>don&#8217;t delete it yet.</strong>&nbsp;Keep it open in a separate window for reference while you set up the equivalent Heft plugins in the next section.</p>



<h3 class="wp-block-heading" id="step-9-upgrade-your-spfx-production-dependencies">Step 9: Upgrade Your SPFx Production Dependencies</h3>



<p>Update the core SPFx packages to v1.22:</p>



<pre class="wp-block-preformatted">npm install @microsoft/sp-component-base@1.22.1 @microsoft/sp-core-library@1.22.1 @microsoft/sp-lodash-subset@1.22.1 @microsoft/sp-office-ui-fabric-core@1.22.1 @microsoft/sp-property-pane@1.22.1 @microsoft/sp-webpart-base@1.22.1 --save-exact</pre>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="1c1a1a" data-has-transparency="false" style="--dominant-color: #1c1a1a;" loading="lazy" decoding="async" width="1024" height="435" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/upgrade-spfx-production-dependencies-1024x435.avif" alt="upgrade spfx production dependencies" class="wp-image-133935 not-transparent" title="upgrade spfx production dependencies" srcset="https://www.spguides.com/wp-content/uploads/2026/04/upgrade-spfx-production-dependencies-1024x435.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/upgrade-spfx-production-dependencies-300x127.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/upgrade-spfx-production-dependencies-768x326.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/upgrade-spfx-production-dependencies.avif 1474w" /></figure></div>


<p>After making so many changes to packages, I&#8217;d strongly recommend doing a full clean reinstall:</p>



<pre class="wp-block-preformatted"><em># Windows (PowerShell)</em><br>Remove-Item -Recurse -Force node_modules<br>Remove-Item -Force package-lock.json<br><br><em># Mac/Linux</em><br>rm -rf node_modules package-lock.json<br><br><em># Then reinstall everything cleanly</em><br>npm install<br></pre>



<p>This ensures your dependency tree is consistent and you&#8217;re not carrying over any stale Gulp-related packages.</p>



<h3 class="wp-block-heading" id="step-10-test-the-migration">Step 10: Test the Migration</h3>



<p>Run a build to verify everything works:</p>



<pre class="wp-block-preformatted">npm run build</pre>



<p>Or if you have Heft installed globally:</p>



<pre class="wp-block-preformatted">heft build --production</pre>



<p>If the build completes without errors, you&#8217;re done with the core migration. Fire up the dev server with:</p>



<pre class="wp-block-preformatted">npm run start<br><em># or</em><br>heft start --clean</pre>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="203f69" data-has-transparency="false" style="--dominant-color: #203f69;" loading="lazy" decoding="async" width="1024" height="569" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/microsoft-spfx-heft-plugins-1024x569.avif" alt="microsoft spfx heft plugins" class="wp-image-133941 not-transparent" title="microsoft spfx heft plugins" srcset="https://www.spguides.com/wp-content/uploads/2026/04/microsoft-spfx-heft-plugins-1024x569.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/microsoft-spfx-heft-plugins-300x167.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/microsoft-spfx-heft-plugins-768x426.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/microsoft-spfx-heft-plugins.avif 1232w" /></figure></div>


<p>This will automatically open the workbench url. In case you are getting an error like in the image below. </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="e3e8eb" data-has-transparency="false" style="--dominant-color: #e3e8eb;" loading="lazy" decoding="async" width="982" height="298" sizes="(max-width: 982px) 100vw, 982px" src="https://www.spguides.com/wp-content/uploads/2026/04/Unable-to-load-SPFx-webpart-after-deploy.avif" alt="Unable to load SPFx webpart after deploy" class="wp-image-133944 not-transparent" title="Unable to load SPFx webpart after deploy" srcset="https://www.spguides.com/wp-content/uploads/2026/04/Unable-to-load-SPFx-webpart-after-deploy.avif 982w, https://www.spguides.com/wp-content/uploads/2026/04/Unable-to-load-SPFx-webpart-after-deploy-300x91.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/Unable-to-load-SPFx-webpart-after-deploy-768x233.avif 768w" /></figure></div>


<p>Just run the following command.</p>



<pre class="wp-block-code"><code>npm run trust-dev-cert</code></pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="10325d" data-has-transparency="false" style="--dominant-color: #10325d;" loading="lazy" decoding="async" width="696" height="246" sizes="(max-width: 696px) 100vw, 696px" src="https://www.spguides.com/wp-content/uploads/2026/04/spfx-failed-to-load-component.avif" alt="spfx failed to load component" class="wp-image-133945 not-transparent" title="spfx failed to load component" srcset="https://www.spguides.com/wp-content/uploads/2026/04/spfx-failed-to-load-component.avif 696w, https://www.spguides.com/wp-content/uploads/2026/04/spfx-failed-to-load-component-300x106.avif 300w" /></figure></div>


<p>Then, re-run the <code>npm run start</code> command; this time, without errors, you can get your web part as shown below.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="eeece3" data-has-transparency="false" style="--dominant-color: #eeece3;" loading="lazy" decoding="async" width="1024" height="524" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/migrating-gulp-packages-to-heft-in-sharepoint-framework-1024x524.avif" alt="migrating gulp packages to heft in sharepoint framework" class="wp-image-133949 not-transparent" title="migrating gulp packages to heft in sharepoint framework" srcset="https://www.spguides.com/wp-content/uploads/2026/04/migrating-gulp-packages-to-heft-in-sharepoint-framework-1024x524.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/migrating-gulp-packages-to-heft-in-sharepoint-framework-300x153.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/migrating-gulp-packages-to-heft-in-sharepoint-framework-768x393.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/migrating-gulp-packages-to-heft-in-sharepoint-framework.avif 1232w" /></figure></div>


<h2 class="wp-block-heading" id="handling-custom-gulpfilejs-tasks">Handling Custom gulpfile.js Tasks</h2>



<p>This is where it gets more involved. If your old&nbsp;<code>gulpfile.js</code>&nbsp;was just the default SPFx boilerplate, you&#8217;re done. But if you had custom tasks, here&#8217;s how to handle the most common ones:</p>



<h2 class="wp-block-heading" id="custom-webpack-configuration">Custom Webpack Configuration</h2>



<p>If you were using&nbsp;<code>build.configureWebpack.mergeConfig()</code>&nbsp;to inject custom Webpack settings, you have two options in Heft:</p>



<p><strong>Option 1 — Use the webpack patch file (simpler):</strong></p>



<p>Create a file at&nbsp;<code>./config/webpack.extend.js</code>:</p>



<pre class="wp-block-preformatted">module.exports = function (existingConfig) {<br>  existingConfig.resolve = existingConfig.resolve || {};<br>  existingConfig.resolve.alias = {<br>    ...existingConfig.resolve.alias,<br>    '@myAlias': require('path').resolve(__dirname, '../src/helpers')<br>  };<br>  return existingConfig;<br>};<br></pre>



<p>Then reference it in your&nbsp;<code>heft.json</code>&nbsp;(more on that file below).</p>



<p><strong>Option 2 — Eject Webpack entirely (for complex cases):</strong></p>



<pre class="wp-block-preformatted">heft eject-webpack</pre>



<p>This generates a full&nbsp;<code>webpack.config.js</code>&nbsp;in your project that you can modify directly. It&#8217;s the escape hatch for when you need complete control.</p>



<h2 class="wp-block-heading" id="custom-prepost-build-tasks">Custom Pre/Post Build Tasks</h2>



<p>If you had&nbsp;<code>build.rig.addPreBuildTask()</code>&nbsp;or&nbsp;<code>addPostBuildTask()</code>&nbsp;For things like copying extra files or running scripts, use Heft&#8217;s&nbsp;<code>run-script-plugin</code>.</p>



<p>Create&nbsp;<code>./config/heft.json</code>:</p>



<pre class="wp-block-preformatted">{<br>  "$schema": "https://developer.microsoft.com/json-schemas/heft/v0/heft.schema.json",<br>  "extends": "@microsoft/spfx-web-build-rig/profiles/default/config/heft.json",<br>  "phasesByName": {<br>    "build": {<br>      "tasksByName": {<br>        "my-custom-script": {<br>          "taskPlugin": {<br>            "pluginPackage": "@rushstack/heft",<br>            "pluginName": "run-script-plugin",<br>            "options": {<br>              "scriptPath": "./scripts/my-custom-task.js"<br>            }<br>          }<br>        }<br>      }<br>    }<br>  }<br>}<br></pre>



<p>Create&nbsp;<code>./scripts/my-custom-task.js</code>&nbsp;and put your custom logic there. This script runs as part of the build phase.</p>



<h2 class="wp-block-heading" id="copying-files">Copying Files</h2>



<p>The old&nbsp;<code>build.copyStaticAssets</code>&nbsp;type of operations now live in&nbsp;<code>typescript.json</code>&nbsp;under&nbsp;<code>staticAssetsToCopy</code>&nbsp;(which we already configured in Step 6). For more complex copy scenarios, use the&nbsp;<code>copy-files-plugin</code>&nbsp;in&nbsp;<code>heft.json</code>.</p>



<h2 class="wp-block-heading" id="common-issues-and-fixes">Common Issues and Fixes</h2>



<p>A few things that tend to trip people up during migration:</p>



<ul class="wp-block-list">
<li><strong>ESLint errors after migration:</strong>&nbsp;Your old&nbsp;<code>.eslintrc.js</code>&nbsp;may reference&nbsp;<code>@microsoft/eslint-config-spfx</code>&nbsp;in a way that conflicts with the new package. Update the&nbsp;<code>extends</code>&nbsp;in your ESLint config to use&nbsp;<code>@rushstack/eslint-config</code>&nbsp;and re-run the build.</li>



<li><strong>&#8220;Cannot find module&#8221; errors:</strong>&nbsp;Usually means stale&nbsp;<code>node_modules</code>. Do the clean reinstall from Step 9.</li>



<li><strong>TypeScript errors you didn&#8217;t have before:</strong>&nbsp;If you upgraded to TypeScript v5.8, some stricter type checks may now flag issues that were silently ignored before. Fix them or stay on TypeScript v5.3 for now.</li>



<li><strong>PnP SPFx Controls not working:</strong>&nbsp;If you use&nbsp;<code>@pnp/spfx-controls-react</code>, make sure you&#8217;re on a version that supports SPFx v1.22. Run&nbsp;<code>npm ls @pnp/spfx-controls-react</code>&nbsp;to check your current version and compare with their release notes.</li>



<li><strong>Dev cert issues:</strong>&nbsp;If HTTPS fails on the local workbench, run&nbsp;<code>heft trust-dev-cert</code>&nbsp;to re-trust the certificate.</li>
</ul>



<h2 class="wp-block-heading" id="using-the-m365-cli-to-generate-an-upgrade-report-o">Using the M365 CLI to Generate an Upgrade Report (Optional but Helpful)</h2>



<p>If you want a full list of every change needed for your specific project before you manually edit anything, the Microsoft 365 CLI can generate an upgrade report for you:</p>



<pre class="wp-block-preformatted"><em># Install M365 CLI if you don't have it</em><br>npm i -g @pnp/cli-microsoft365<br><br><em># Generate the upgrade report</em><br>m365 spfx project upgrade --toVersion 1.22.0 --preview --output md &gt; upgrade-report.md<br></pre>



<p>Open&nbsp;<code>upgrade-report.md</code>&nbsp;— it will list every dependency that needs to change, every script to update, and any manual steps specific to your project. It&#8217;s a great way to audit before you start making changes.</p>



<h2 class="wp-block-heading" id="what-the-final-project-structure-looks-like">What the Final Project Structure Looks Like</h2>



<p>After migration, here&#8217;s what your key config files should look like:</p>



<pre class="wp-block-preformatted">your-spfx-project/<br>├── config/<br>│   ├── rig.json          ← NEW (points to spfx-web-build-rig)<br>│   ├── heft.json         ← NEW (only if you have custom tasks)<br>│   ├── sass.json         ← UPDATED (now extends rig)<br>│   ├── typescript.json   ← NEW (configures TS plugin)<br>│   └── package-solution.json (unchanged)<br>├── tsconfig.json         ← UPDATED (now extends rig's base config)<br>├── package.json          ← UPDATED (scripts use heft commands)<br>├── gulpfile.js           ← DELETED<br>└── src/                  (unchanged)<br></pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="eeeded" data-has-transparency="false" style="--dominant-color: #eeeded;" loading="lazy" decoding="async" width="494" height="804" sizes="(max-width: 494px) 100vw, 494px" src="https://www.spguides.com/wp-content/uploads/2026/04/migrate-from-the-gulp-based-to-the-heft-based-toolchain.avif" alt="migrate from the gulp-based to the heft-based toolchain" class="wp-image-133930 not-transparent" title="migrate from the gulp based to the heft based toolchain" srcset="https://www.spguides.com/wp-content/uploads/2026/04/migrate-from-the-gulp-based-to-the-heft-based-toolchain.avif 494w, https://www.spguides.com/wp-content/uploads/2026/04/migrate-from-the-gulp-based-to-the-heft-based-toolchain-184x300.avif 184w" /></figure></div>


<h2 class="wp-block-heading" id="wrapping-up">Wrapping Up</h2>



<p>In this tutorial, I explained how to migrate from Gulp based toolchain to Heft based toolchain in the SharePoint Framework (SPFx). Follow the above steps, and you should be able to migrate your project.</p>



<p>The key things to remember:</p>



<ul class="wp-block-list">
<li>Uninstall the old Gulp packages and install the Heft equivalents</li>



<li>Add&nbsp;<code>rig.json</code>&nbsp;to point to&nbsp;<code>@microsoft/spfx-web-build-rig</code></li>



<li>Update your config files (sass.json, typescript.json, tsconfig.json)</li>



<li>Replace your npm scripts with&nbsp;<code>heft</code>&nbsp;commands</li>



<li>Delete&nbsp;<code>gulpfile.js</code>&nbsp;(but migrate any custom tasks first)</li>



<li>Do a clean&nbsp;<code>npm install</code>&nbsp;at the end to flush out any stale dependencies</li>
</ul>



<p>If you&#8217;ve got custom Gulp tasks, the translation to Heft plugins takes a bit of extra thought — but the&nbsp;<code>run-script-plugin</code>&nbsp;and&nbsp;<code>copy-files-plugin</code>&nbsp;cover most real-world scenarios.</p>



<div class="wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-16018d1d wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://www.spguides.com/download-spfx-solutions/">Download SPFx Solutions</a></div>
</div>



<p>Also, you may like:</p>



<ul class="wp-block-list">
<li><a href="https://www.spguides.com/create-modal-popup-in-spfx/">Create a Modal Popup in SPFx</a></li>



<li><a href="https://www.spguides.com/bind-sharepoint-list-items-to-spfx-fluent-ui-react-dropdown/">Bind SharePoint List Items to SPFx Fluent UI React Dropdown</a></li>



<li><a href="https://www.spguides.com/customize-sharepoint-list-command-bar-download-button-using-spfx-extension/">Customize SharePoint List Command Bar Download Button Using SPFx Extension</a></li>



<li><a href="https://www.spguides.com/spfx-upload-file-to-sharepoint-document-library-with-metadata/">Upload File to SharePoint Document Library With Metadata in SPFx</a></li>
</ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Power Apps Weekday Function &#8211; With Real Examples</title>
		<link>https://www.spguides.com/power-apps-weekday-function/</link>
		
		<dc:creator><![CDATA[Bijay Kumar]]></dc:creator>
		<pubDate>Tue, 28 Apr 2026 11:00:00 +0000</pubDate>
				<category><![CDATA[Power Apps]]></category>
		<category><![CDATA[Power Apps Weekday Function]]></category>
		<guid isPermaLink="false">https://www.spguides.com/?p=132581</guid>

					<description><![CDATA[If you&#8217;ve ever needed to figure out what day of the week a date falls on inside Power Apps, the Weekday function is exactly what you&#8217;re looking for. I use it all the time for things like skipping weekends in date pickers, highlighting working days, or just showing the day name next to a date. In this ... <a title="Power Apps Weekday Function &#8211; With Real Examples" class="read-more" href="https://www.spguides.com/power-apps-weekday-function/" aria-label="Read more about Power Apps Weekday Function &#8211; With Real Examples">read more...</a>]]></description>
										<content:encoded><![CDATA[
<p>If you&#8217;ve ever needed to figure out what day of the week a date falls on inside Power Apps, the <strong>Weekday function</strong> is exactly what you&#8217;re looking for. I use it all the time for things like skipping weekends in date pickers, highlighting working days, or just showing the day name next to a date.</p>



<p>In this <a href="https://www.tsinfotechnologies.com/products/" target="_blank" rel="noopener">Power Apps tutorial</a>, I&#8217;ll walk you through everything &#8211; from the basic syntax to real-world use cases where the Power Apps Weekday function actually works.</p>



<h2 class="wp-block-heading" id="what-does-the-weekday-function-do">What Does The Power Apps Weekday Function Do?</h2>



<p>Simply put, the Power Apps <code>Weekday()</code>&nbsp;takes a date and returns a number representing the day of the week. By default,&nbsp;<strong>1 = Sunday and 7 = Saturday</strong>.</p>



<p>That&#8217;s it. It returns a number. But what you&nbsp;<em>do</em>&nbsp;with that number is where the logic starts.</p>



<p><strong>Syntax</strong></p>



<pre class="wp-block-preformatted">Weekday( DateTime [, WeekdayFirst] )</pre>



<ul class="wp-block-list">
<li><strong>DateTime</strong>&nbsp;— Required. This is the date you want to evaluate. Can be&nbsp;<code>Today()</code>,&nbsp;<code>Now()</code>, a date from a DatePicker, or any Date/Time value.</li>



<li><strong>WeekdayFirst</strong> — Optional. This tells Power Apps which day of the week your week starts on. If you leave it out, Sunday is treated as day 1.</li>
</ul>



<h2 class="wp-block-heading" id="understanding-the-weekdayfirst-parameter">Power Apps Weekday Function</h2>



<p>This optional second parameter is what trips most people up. Power Apps gives you two ways to set it:</p>



<h3 class="wp-block-heading">Option 1: Use The StartOfWeek Enumeration (Recommended)</h3>



<p>This is the cleaner, more readable approach.</p>



<figure class="wp-block-table is-style-stripes"><table class="has-fixed-layout"><thead><tr><th>Enumeration Value</th><th>Week Starts On</th><th>Range</th></tr></thead><tbody><tr><td><code>StartOfWeek.Sunday</code></td><td>Sunday</td><td>1 (Sun) → 7 (Sat)</td></tr><tr><td><code>StartOfWeek.Monday</code></td><td>Monday</td><td>1 (Mon) → 7 (Sun)</td></tr><tr><td><code>StartOfWeek.MondayZero</code></td><td>Monday</td><td>0 (Mon) → 6 (Sun)</td></tr><tr><td><code>StartOfWeek.Tuesday</code></td><td>Tuesday</td><td>1 (Tue) → 7 (Mon)</td></tr><tr><td><code>StartOfWeek.Wednesday</code></td><td>Wednesday</td><td>1 (Wed) → 7 (Tue)</td></tr><tr><td><code>StartOfWeek.Thursday</code></td><td>Thursday</td><td>1 (Thu) → 7 (Wed)</td></tr><tr><td><code>StartOfWeek.Friday</code></td><td>Friday</td><td>1 (Fri) → 7 (Thu)</td></tr><tr><td><code>StartOfWeek.Saturday</code></td><td>Saturday</td><td>1 (Sat) → 7 (Fri)</td></tr></tbody></table></figure>



<h3 class="wp-block-heading">Option 2: Use Excel-style Numeric Codes</h3>



<p>If you&#8217;re coming from an <a href="https://www.spguides.com/power-bi-export-to-excel/">Excel </a>background, you can pass in a number instead:</p>



<figure class="wp-block-table is-style-stripes"><table class="has-fixed-layout"><thead><tr><th>Excel Code</th><th>Same As</th></tr></thead><tbody><tr><td>1 or 17</td><td>StartOfWeek.Sunday</td></tr><tr><td>2 or 11</td><td>StartOfWeek.Monday</td></tr><tr><td>3</td><td>StartOfWeek.MondayZero</td></tr><tr><td>12</td><td>StartOfWeek.Tuesday</td></tr><tr><td>13</td><td>StartOfWeek.Wednesday</td></tr><tr><td>14</td><td>StartOfWeek.Thursday</td></tr><tr><td>15</td><td>StartOfWeek.Friday</td></tr><tr><td>16</td><td>StartOfWeek.Saturday</td></tr></tbody></table></figure>



<p>I personally prefer the&nbsp;<code>StartOfWeek</code>&nbsp;enumeration — it&#8217;s easier to read in a formula six months later.</p>



<h2 class="wp-block-heading" id="basic-examples">Power Apps Weekday Function Examples</h2>



<p>Let&#8217;s say today is&nbsp;<strong>Thursday, April 9, 2015</strong>&nbsp;(a date from Microsoft&#8217;s own docs, just so we have something concrete).</p>



<pre class="wp-block-preformatted">Weekday( Now() )<br>// Returns: 5<br>// Because Thursday is the 5th day when Sunday = 1</pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f6f4f5" data-has-transparency="false" style="--dominant-color: #f6f4f5;" loading="lazy" decoding="async" width="772" height="296" sizes="(max-width: 772px) 100vw, 772px" src="https://www.spguides.com/wp-content/uploads/2026/04/powerapps-weekday.avif" alt="powerapps weekday" class="wp-image-134061 not-transparent" title="powerapps weekday" srcset="https://www.spguides.com/wp-content/uploads/2026/04/powerapps-weekday.avif 772w, https://www.spguides.com/wp-content/uploads/2026/04/powerapps-weekday-300x115.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/powerapps-weekday-768x294.avif 768w" /></figure></div>


<pre class="wp-block-preformatted">Weekday( Now(), StartOfWeek.Monday )<br>// Returns: 4<br>// Because Thursday is the 4th day when Monday = 1</pre>



<pre class="wp-block-preformatted">Weekday( Now(), StartOfWeek.Wednesday )<br>// Returns: 2<br>// Because Thursday is the 2nd day when Wednesday = 1</pre>



<pre class="wp-block-preformatted">Weekday( Now(), 14 )<br>// Returns: 1<br>// Using Excel code 14 (Thursday as start), Thursday itself = 1</pre>



<p>These are simple checks. Now let&#8217;s get into the stuff you&#8217;ll actually build with.</p>



<h3 class="wp-block-heading" id="1-show-the-day-name-from-a-date">Example 1: Show The Day Name From a Date in Power Apps</h3>



<p>The&nbsp;Power Apps <strong>Weekday()&nbsp;function</strong> returns a number, not the day name. But you can convert it using a&nbsp;<code>Switch</code>&nbsp;statement. Put this in a Label&#8217;s&nbsp;<strong>Text</strong>&nbsp;property:</p>



<pre class="wp-block-preformatted">Switch(<br>    Weekday(DatePicker1.SelectedDate, StartOfWeek.Sunday),<br>    1, "Sunday",<br>    2, "Monday",<br>    3, "Tuesday",<br>    4, "Wednesday",<br>    5, "Thursday",<br>    6, "Friday",<br>    7, "Saturday"<br>)</pre>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f5f4f4" data-has-transparency="false" style="--dominant-color: #f5f4f4;" loading="lazy" decoding="async" width="1024" height="341" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/power-apps-weekly-calendar-1024x341.avif" alt="power apps weekly calendar" class="wp-image-134063 not-transparent" title="power apps weekly calendar" srcset="https://www.spguides.com/wp-content/uploads/2026/04/power-apps-weekly-calendar-1024x341.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/power-apps-weekly-calendar-300x100.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/power-apps-weekly-calendar-768x256.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/power-apps-weekly-calendar.avif 1184w" /></figure></div>


<p>This displays the full day name for whatever date the user picks. Clean and easy to read.</p>



<p>If you just want a short version like &#8220;Mon&#8221; or &#8220;Thu&#8221;, you can also use the&nbsp;<code>Text()</code>&nbsp;function with a format string:</p>



<pre class="wp-block-preformatted">Text(DatePicker1.SelectedDate, "ddd")   // "Thu"<br>Text(DatePicker1.SelectedDate, "dddd")  // "Thursday"</pre>



<p>Both work. I tend to use&nbsp;<strong>Text()</strong>&nbsp;when all I need is the name, and&nbsp;Weekday()&nbsp;+&nbsp;Switch()&nbsp;when I need to make logical decisions based on the day.</p>



<h3 class="wp-block-heading" id="2-check-if-a-date-falls-on-a-weekend">Example 2: Check If a Date Falls On a Weekend In Power Apps</h3>



<p>This is probably the most common use of <code>Weekday()</code> in real <a href="https://www.spguides.com/download-power-platform-solutions/">Power Apps apps</a>. Say you want to warn a user if they&#8217;ve picked a Saturday or Sunday:</p>



<pre class="wp-block-preformatted">If(<br>    Weekday(DatePicker1.SelectedDate) = 1 || <br>    Weekday(DatePicker1.SelectedDate) = 7,<br>    "Weekend — please pick a working day",<br>    "Good to go!"<br>)</pre>



<p>Here,&nbsp;<code>1 = Sunday</code>&nbsp;and&nbsp;<code>7 = Saturday</code>&nbsp;(default Sunday-first week).</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f6f5f6" data-has-transparency="false" style="--dominant-color: #f6f5f6;" loading="lazy" decoding="async" width="1024" height="285" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/power-apps-weekday-function-1024x285.avif" alt="power apps weekday function" class="wp-image-134064 not-transparent" title="power apps weekday function" srcset="https://www.spguides.com/wp-content/uploads/2026/04/power-apps-weekday-function-1024x285.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/power-apps-weekday-function-300x83.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/power-apps-weekday-function-768x213.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/power-apps-weekday-function.avif 1396w" /></figure></div>


<p>You can also hide or disable a button based on this logic. Put this in a button&#8217;s&nbsp;<strong>DisplayMode</strong>&nbsp;property:</p>



<pre class="wp-block-preformatted">If(<br>    Weekday(DatePicker1.SelectedDate) = 1 || <br>    Weekday(DatePicker1.SelectedDate) = 7,<br>    DisplayMode.Disabled,<br>    DisplayMode.Edit<br>)</pre>



<p>That way, users literally can&#8217;t submit on a weekend. Super useful for leave request forms or booking apps.</p>



<h3 class="wp-block-heading" id="3-highlight-weekends-in-a-calendar">Example 3: Highlight Weekends in a Power Apps Calendar</h3>



<p>If you&#8217;re building a custom calendar <a href="https://www.spguides.com/create-a-horizontal-scrollable-gallery-in-power-apps/">gallery in Power Apps</a>, you can use&nbsp;<code>Weekday()</code>&nbsp;to change the background color of weekend cells. Put this in the&nbsp;<strong>Fill</strong>&nbsp;property of your gallery item:</p>



<pre class="wp-block-preformatted">If(<br>    Weekday(ThisItem.Date, StartOfWeek.Monday) &gt;= 6,<br>    RGBA(255, 230, 230, 1),  // Light red for weekends<br>    RGBA(255, 255, 255, 1)   // White for weekdays<br>)</pre>



<p>With&nbsp;<code>StartOfWeek.Monday</code>, day 6 = Saturday and day 7 = Sunday — so&nbsp;<code>&gt;= 6</code>&nbsp;catches both.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f4f1f1" data-has-transparency="false" style="--dominant-color: #f4f1f1;" loading="lazy" decoding="async" width="1024" height="540" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/powerapps-get-weekday-from-date-1024x540.avif" alt="powerapps get weekday from date" class="wp-image-134065 not-transparent" title="powerapps get weekday from date" srcset="https://www.spguides.com/wp-content/uploads/2026/04/powerapps-get-weekday-from-date-1024x540.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/powerapps-get-weekday-from-date-300x158.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/powerapps-get-weekday-from-date-768x405.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/powerapps-get-weekday-from-date.avif 1042w" /></figure></div>


<h3 class="wp-block-heading" id="4-find-the-monday-of-the-current-week">Example 4: Find the Monday Of The Current Week in Power Apps</h3>



<p>This is a classic need for Power Apps timesheet apps or weekly reports. You want to jump back to the Monday of whatever week the user is in.</p>



<pre class="wp-block-preformatted">DateAdd(<br>    Today(),<br>    -(Weekday(Today(), StartOfWeek.MondayZero)),<br>    TimeUnit.Days<br>)</pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f4f3f3" data-has-transparency="false" style="--dominant-color: #f4f3f3;" loading="lazy" decoding="async" width="972" height="388" sizes="(max-width: 972px) 100vw, 972px" src="https://www.spguides.com/wp-content/uploads/2026/04/power-apps-date-format-long-abbreviated.avif" alt="power apps date format long abbreviated" class="wp-image-134067 not-transparent" title="power apps date format long abbreviated" srcset="https://www.spguides.com/wp-content/uploads/2026/04/power-apps-date-format-long-abbreviated.avif 972w, https://www.spguides.com/wp-content/uploads/2026/04/power-apps-date-format-long-abbreviated-300x120.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/power-apps-date-format-long-abbreviated-768x307.avif 768w" /></figure></div>


<p><strong>StartOfWeek.MondayZero</strong>&nbsp;returns 0 for Monday, 1 for Tuesday, and so on up to 6 for Sunday. So subtracting that number from today always lands you on the Monday of the current week.</p>



<p>And once you have Monday, you can get the rest of the week easily:</p>



<pre class="wp-block-preformatted">// Tuesday<br>DateAdd(Today(), -(Weekday(Today(), StartOfWeek.MondayZero)) + 1, TimeUnit.Days)<br><br>// Wednesday<br>DateAdd(Today(), -(Weekday(Today(), StartOfWeek.MondayZero)) + 2, TimeUnit.Days)<br><br>// Thursday<br>DateAdd(Today(), -(Weekday(Today(), StartOfWeek.MondayZero)) + 3, TimeUnit.Days)<br><br>// Friday<br>DateAdd(Today(), -(Weekday(Today(), StartOfWeek.MondayZero)) + 4, TimeUnit.Days)</pre>



<p>This is exactly what you&#8217;d use to auto-fill date boxes in a weekly timesheet form.</p>



<h3 class="wp-block-heading" id="5-filter-out-weekends-from-a-date-collection">Example 5: Filter Out Weekends From a Power Apps Date Collection</h3>



<p>Sometimes you need to build a <a href="https://www.spguides.com/how-to-add-image-in-a-power-apps-collection/">Power Apps Collection</a> of only working days—for example, to populate a dropdown with the next 30 business days. Here&#8217;s how to do that using Weekday() inside a <code>ForAll()</code> + <code>If()</code> combo:</p>



<pre class="wp-block-preformatted">ClearCollect(<br>    colBusinessDays,<br>    ForAll(<br>        Sequence(30, 1, 1),<br>        If(<br>            !(Weekday(DateAdd(Today(), Value)) = 1 ||<br>              Weekday(DateAdd(Today(), Value)) = 7),<br>            {<br>                RowID: Value,<br>                Date: DateAdd(Today(), Value)<br>            }<br>        )<br>    )<br>)</pre>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f8f7f7" data-has-transparency="false" style="--dominant-color: #f8f7f7;" loading="lazy" decoding="async" width="1024" height="343" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/weeknum-and-isoweeknum-functions-power-apps-1024x343.avif" alt="weeknum and isoweeknum functions power apps" class="wp-image-134070 not-transparent" title="weeknum and isoweeknum functions power apps" srcset="https://www.spguides.com/wp-content/uploads/2026/04/weeknum-and-isoweeknum-functions-power-apps-1024x343.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/weeknum-and-isoweeknum-functions-power-apps-300x101.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/weeknum-and-isoweeknum-functions-power-apps-768x257.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/weeknum-and-isoweeknum-functions-power-apps-1536x515.avif 1536w, https://www.spguides.com/wp-content/uploads/2026/04/weeknum-and-isoweeknum-functions-power-apps.avif 1540w" /></figure></div>


<p>This loops through the next 30 days, checks each one, and only adds it to the collection if it&#8217;s NOT a Sunday (1) or Saturday (7). You&#8217;d fire this in the&nbsp;<strong>OnStart</strong>&nbsp;of your app or when the screen loads.</p>



<p>Once you have&nbsp;colBusinessDays, you can use it as the Items source in a dropdown or combo box — so users can only ever pick a working day.</p>



<h3 class="wp-block-heading" id="6-calculate-the-next-business-day">Example 6: Calculate the Next Business Day In Power Apps</h3>



<p>Need to auto-suggest the next available working day? This is useful for delivery <a href="https://www.spguides.com/power-apps-calculate-days-between-dates/">date pickers</a> or SLA calculators:</p>



<pre class="wp-block-preformatted">// Find next business day from today<br>If(<br>    Weekday(Today()) = 6,  // Friday<br>    DateAdd(Today(), 3),   // Skip to Monday<br>    If(<br>        Weekday(Today()) = 7,  // Saturday<br>        DateAdd(Today(), 2),   // Skip to Monday<br>        DateAdd(Today(), 1)    // Just add one day<br>    )<br>)</pre>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f3f2f2" data-has-transparency="false" style="--dominant-color: #f3f2f2;" loading="lazy" decoding="async" width="1024" height="383" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/isoweeknum-vs-weeknum-1024x383.avif" alt="isoweeknum vs weeknum" class="wp-image-134073 not-transparent" title="isoweeknum vs weeknum" srcset="https://www.spguides.com/wp-content/uploads/2026/04/isoweeknum-vs-weeknum-1024x383.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/isoweeknum-vs-weeknum-300x112.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/isoweeknum-vs-weeknum-768x287.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/isoweeknum-vs-weeknum.avif 1032w" /></figure></div>


<p>This handles Friday and Saturday edge cases, both skip forward to the next Monday. Any other day just adds one day.</p>



<h3 class="wp-block-heading" id="7-count-business-days-between-two-dates">Example 7: Count Business Days Between Two Dates in Power Apps</h3>



<p>This one is a bit more involved but really useful. You can&#8217;t just subtract two dates and call it business days — you need to exclude weekends. Here&#8217;s how to do it:</p>



<pre class="wp-block-preformatted">CountIf(<br>    ForAll(<br>        Sequence(DateDiff(StartDate, EndDate, TimeUnit.Days), 0),<br>        {<br>            DayNum: Weekday(DateAdd(StartDate, Value, TimeUnit.Days))<br>        }<br>    ),<br>    DayNum &lt;&gt; 1 &amp;&amp; DayNum &lt;&gt; 7<br>)</pre>



<p>Replace&nbsp;<code>StartDate</code>&nbsp;and&nbsp;<code>EndDate</code>&nbsp;with your actual date values or DatePicker references. This creates a sequence of all days between the two dates, checks each one&#8217;s weekday number, and counts only those that aren&#8217;t Sunday or Saturday.</p>



<h2 class="wp-block-heading" id="weekday-vs-text--which-should-you-use">Power Apps Weekday() vs. Text() — Which Should You Use?</h2>



<p>I get this question a lot. Here&#8217;s a quick way to think about it:</p>



<ul class="wp-block-list">
<li>Use <strong><code>Weekday()</code></strong> When you need to make a decision based on the day, such as checking whether it&#8217;s a weekend, filtering a collection, or calculating offsets.</li>



<li>Use&nbsp;<strong><code>Text()</code></strong>&nbsp;when you just want to display the name of the day — like&nbsp;<code>Text(Today(), "dddd")</code>&nbsp;showing &#8220;Monday&#8221;.</li>
</ul>



<p>They solve different problems. In many real apps, you&#8217;ll end up using both.</p>



<h2 class="wp-block-heading" id="common-mistakes-to-avoid">Common Mistakes to Avoid</h2>



<ul class="wp-block-list">
<li><strong>Forgetting the default is Sunday = 1.</strong>&nbsp;If your app is for a Monday-to-Friday workforce, always pass&nbsp;<code>StartOfWeek.Monday</code>&nbsp;to avoid off-by-one errors.</li>



<li><strong>Using the wrong Excel code.</strong>&nbsp;The numeric codes can be confusing. Stick to&nbsp;<code>StartOfWeek</code>&nbsp;enumerations — they&#8217;re self-documenting.</li>



<li><strong>Using&nbsp;<code>Weekday()</code>&nbsp;directly in a dropdown Items property.</strong>&nbsp;It returns a number, not a list. Wrap your logic in a&nbsp;ForAll()&nbsp;or&nbsp;Switch()&nbsp;first.</li>



<li><strong>Not handling the Friday/Sunday edge case</strong>&nbsp;when calculating the next business day. Always think about what happens on weekends.</li>
</ul>



<h2 class="wp-block-heading" id="quick-reference">Power Apps Weekday() &amp; Text() Formulas Explanation</h2>



<p>In the table below, I added a few Power Apps Weekday() and Text() formulas and their outputs. Have a look at it.</p>



<figure class="wp-block-table is-style-stripes"><table class="has-fixed-layout"><thead><tr><th>Formula</th><th>What It Does</th></tr></thead><tbody><tr><td><code>Weekday(Today())</code></td><td>Returns 1–7 (Sun=1) for today</td></tr><tr><td><code>Weekday(Today(), StartOfWeek.Monday)</code></td><td>Returns 1–7 (Mon=1) for today</td></tr><tr><td><code>Weekday(DatePicker1.SelectedDate) = 1</code></td><td>True if selected date is Sunday</td></tr><tr><td><code>Weekday(DatePicker1.SelectedDate) = 7</code></td><td>True if selected date is Saturday</td></tr><tr><td><code>Text(Today(), "dddd")</code></td><td>Returns full day name like &#8220;Monday&#8221;</td></tr><tr><td><code>Text(Today(), "ddd")</code></td><td>Returns short day name like &#8220;Mon.&#8221;</td></tr></tbody></table></figure>



<h2 class="wp-block-heading" id="wrapping-up">Conclusion</h2>



<p>I hope you found this article helpful. In this guide, I explained how the Weekday function works in Power Apps. I also showed how to use the StartOfWeek option and different examples. These examples help you easily understand how to work with dates.</p>



<p>If you are building apps with date logic, this function will be very useful. You can use it for calendars, business day checks, and more. Try combining it with Switch, ForAll, and DateAdd for better results. With practice, working with dates will become simple.</p>



<p>Also, you may like:</p>



<ul class="wp-block-list">
<li><a href="https://www.spguides.com/power-apps-refresh-function/">Power Apps Refresh Function – With Examples</a></li>



<li><a href="https://www.spguides.com/create-tabs-in-power-apps/">Create Tabs in Power Apps [Using Modern Tab List]</a></li>



<li><a href="https://www.spguides.com/create-a-folder-in-sharepoint-from-power-apps/">2 Best Ways to Create a Folder in SharePoint From Power Apps</a></li>



<li><a href="https://www.spguides.com/get-current-screen-name-in-power-apps/">Get Current Screen Name in Power Apps</a></li>
</ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Set Up Your SharePoint Framework (SPFx) Development Environment using Heft Toolchain</title>
		<link>https://www.spguides.com/set-up-spfx-project-with-heft/</link>
		
		<dc:creator><![CDATA[Bijay Kumar]]></dc:creator>
		<pubDate>Mon, 27 Apr 2026 13:37:31 +0000</pubDate>
				<category><![CDATA[SharePoint Framework]]></category>
		<category><![CDATA[Set Up SPFx Project with Heft]]></category>
		<guid isPermaLink="false">https://www.spguides.com/?p=133980</guid>

					<description><![CDATA[If you&#8217;ve been wanting to build custom web parts or extensions for SharePoint, the very first thing you need to do is set up your&#160;SharePoint Framework (SPFx)&#160;development environment. With SPFx 1.22, things have changed. Microsoft has introduced a new build system called Heft, which replaces Gulp and handles the build process more structurally. I&#8217;m going ... <a title="Set Up Your SharePoint Framework (SPFx) Development Environment using Heft Toolchain" class="read-more" href="https://www.spguides.com/set-up-spfx-project-with-heft/" aria-label="Read more about Set Up Your SharePoint Framework (SPFx) Development Environment using Heft Toolchain">read more...</a>]]></description>
										<content:encoded><![CDATA[
<p>If you&#8217;ve been wanting to <a href="https://www.spguides.com/spfx-training-course/" target="_blank" rel="noreferrer noopener">build custom web parts</a> or extensions for SharePoint, the very first thing you need to do is <strong>set up your&nbsp;SharePoint Framework (SPFx)&nbsp;development environment</strong>.</p>



<p>With SPFx 1.22, things have changed. Microsoft has introduced a new build system called Heft, which replaces Gulp and handles the build process more structurally.</p>



<p>I&#8217;m going to walk you through every step — explain what each tool actually does, why you&#8217;re installing it, and flag the important gotchas along the way. By the end, your machine will be fully ready to build real SharePoint solutions.</p>



<p>This tutorial walks you through <strong>setting up your SPFx development environment using the Heft toolchain</strong> step by step. After this, i </p>



<h2 class="wp-block-heading" id="this-guide-is-for-spfx-v122-and-above-heft-based-t">This Guide Is for SPFx v1.22 and Above (Heft-Based Toolchain)</h2>



<p>Here&#8217;s something you absolutely need to know before anything else:&nbsp;<strong>SPFx v1.22 introduced a brand-new toolchain called Heft</strong>, replacing the older Gulp-based build system that was used from SPFx v1.0 all the way through v1.21.1.</p>



<p>This matters because:</p>



<ul class="wp-block-list">
<li>If you&#8217;re building on&nbsp;<strong>SPFx v1.22 or newer</strong>&nbsp;→ you&#8217;re on the&nbsp;<strong>Heft-based toolchain</strong>. This guide is for you.</li>



<li>If you&#8217;re building on&nbsp;<strong>SPFx v1.0 through v1.21.1</strong>, including any on-premises SharePoint Server deployment → you&#8217;re on the&nbsp;<strong>Gulp-based (legacy) toolchain</strong>. Then check this: <a href="https://www.spguides.com/set-up-development-environment-for-sharepoint-framework/" target="_blank" rel="noreferrer noopener">Set up your SharePoint Framework Gulp-based development environment</a>.</li>
</ul>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p><strong>Not sure which version you need?</strong>&nbsp;If you&#8217;re building for SharePoint Online with no constraints, just follow this guide — it uses the latest SPFx. If you need to support a specific version of SharePoint Server on-premises, check the version number requirements first before installing anything.</p>
</blockquote>



<p>The toolchain change is significant. Build configurations, commands, and customizations all changed between these two toolchains. The command you&#8217;ll use to run your project locally, for example, is&nbsp;<code>heft</code>&nbsp;in the new toolchain — not&nbsp;<code>gulp serve</code>. I&#8217;ll cover all of that clearly as we go.</p>



<p>Let&#8217;s first understand what Heft is in SPFx.</p>



<h2 class="wp-block-heading">What is Heft in SharePoint Framework (SPFx) and Why Do We Need This?</h2>



<p>In <strong>SharePoint Framework (SPFx)</strong>, <strong>Heft</strong> is the modern tool that handles everything required to build and package your solution. Earlier, SPFx relied on <strong>Gulp</strong>, which required developers to manage multiple tasks and configurations manually.</p>



<p>Heft simplifies this by providing a standardized and optimized way to run all build-related activities with minimal setup. For a beginner, you can think of Heft as the system that quietly takes your code, processes it, and prepares it so SharePoint can use it.</p>



<p>When you work on an SPFx project, you typically write code in TypeScript and use modern libraries like React. However, SharePoint cannot directly use that raw code. This is where Heft comes in. It compiles your code, bundles all the files together, checks for errors, and prepares the final package that can be deployed. All of this happens behind the scenes when you run simple commands in your terminal.</p>



<p>Heft provides a set of commands that you’ll use regularly during development. The most common one is:</p>



<ul class="wp-block-list">
<li><code>heft build</code> → Compiles your project and prepares the build output.</li>
</ul>



<p>If you want to remove old build files and start fresh, you can use:</p>



<ul class="wp-block-list">
<li><code>heft clean</code> → Deletes previously generated files and clears the build cache.</li>
</ul>



<p>For local development, especially when testing your web part in the browser, you’ll use:</p>



<ul class="wp-block-list">
<li><code>heft start</code> → Starts the local development environment and serves your solution.</li>
</ul>



<p>Once your solution is ready, you need to package it so it can be deployed to SharePoint. For that, Heft provides:</p>



<ul class="wp-block-list">
<li><code>heft package-solution</code> → Creates the <code>.sppkg</code> file used for deployment.</li>
</ul>



<p>If you’re preparing your solution for production, you should use:</p>



<ul class="wp-block-list">
<li><code>heft package-solution --production</code> → Generates an optimized, production-ready package.</li>
</ul>



<p>During development, especially when testing locally over HTTPS, you might need:</p>



<ul class="wp-block-list">
<li><code>heft trust-dev-cert</code> → Installs and trusts a development certificate for secure local testing.</li>
</ul>



<p>In simple terms, Heft is what keeps your SPFx development smooth and consistent. Instead of worrying about how your code is compiled or packaged, you just run these commands, and Heft takes care of the rest. As you grow more comfortable with SPFx, you might explore customizing Heft, but for most developers—especially beginners—it works perfectly out of the box.</p>



<p>Check out <a href="https://www.spguides.com/change-solution-name-in-spfx/">How to Change Solution Name in SPFx</a></p>



<h2 class="wp-block-heading" id="set-up-your-microsoft-365-tenant-first">Set Up Your Microsoft 365 Tenant First</h2>



<p>SPFx solutions run in SharePoint Online, so you need somewhere to test them. Before following the installation steps below, make sure you have a&nbsp;<strong>Microsoft 365 tenant</strong>&nbsp;ready. If you don&#8217;t have one, go to&nbsp;<code>developer.microsoft.com</code>&nbsp;and sign up for the free&nbsp;<strong>Microsoft 365 Developer Program</strong>&nbsp;— it gives you a sandbox tenant you can use freely for development.</p>



<p>You Can Use Any Operating System</p>



<p>One of the great things about SPFx is that you are not locked into Windows. You can use&nbsp;<strong>macOS, Windows, or Linux</strong>&nbsp;— all are fully supported.</p>



<h2 class="wp-block-heading" id="step-1-install-nodejs-v22-lts">Step 1: Install Node.js v22 LTS</h2>



<p>The first thing to install is&nbsp;<strong>Node.js</strong>. Think of Node.js as the engine that powers all the SPFx developer tools. Without it, nothing else will work.</p>



<p><strong>The version you need is Node.js v22 LTS (also known by its codename &#8220;Jod&#8221;).</strong></p>



<p>This is the recommended version for SPFx v1.22.*. If you&#8217;re working on a project using a different SPFx version, verify that your Node.js version is supported for that particular SPFx release before installing.</p>



<h3 class="wp-block-heading" id="lts-vs-current--what-you-need-to-know">LTS vs. Current — What You Need to Know</h3>



<p>Node.js always maintains two release tracks simultaneously:</p>



<ul class="wp-block-list">
<li><strong>LTS (Long Term Support):</strong>&nbsp;Stable, thoroughly tested, and the version that SPFx officially supports.</li>



<li><strong>Current:</strong>&nbsp;Has newer features but is&nbsp;<strong>not supported by SPFx</strong>. Avoid it for SPFx development.</li>
</ul>



<p>Always install an LTS version. SPFx is only supported on LTS versions of Node.js, so do not install the &#8220;Current&#8221; release even if it looks newer on the Node.js website.</p>



<h3 class="wp-block-heading" id="how-to-download-nodejs">How to Download Node.js</h3>



<p>Here&#8217;s how to find the right installer:</p>



<ul class="wp-block-list">
<li>Go to the&nbsp;<strong>Node.js website</strong>&nbsp;(<code>nodejs.org</code>) and navigate to the Downloads page to find a specific version.</li>



<li><strong>Windows users:</strong>&nbsp;Look for the&nbsp;<code>.msi</code>&nbsp;installer files. There are usually two — one for x86 and one for x64 systems. The filenames look like&nbsp;<code>node-v{version-number}-x86.msi</code>&nbsp;or&nbsp;<code>node-v{version-number}-x64.msi</code>. Most modern Windows machines are 64-bit, so you&#8217;ll want the x64 version.</li>



<li><strong>macOS users:</strong>&nbsp;Look for the&nbsp;<code>.pkg</code>&nbsp;installer, usually named&nbsp;<code>node-v{version-number}.pkg</code>.</li>
</ul>



<h3 class="wp-block-heading" id="verify-your-installation">Verify Your Installation</h3>



<p>After installing Node.js, open your terminal (Command Prompt or PowerShell on Windows, Terminal on macOS/Linux) and run:</p>



<pre class="wp-block-preformatted">node --version</pre>



<p>You should see a version number like&nbsp;<code>v22.x.x</code>. If that appears, Node.js is successfully installed, and you&#8217;re ready to move on.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p><strong>Already have Node.js installed?</strong>&nbsp;Run&nbsp;<code>node --version</code>&nbsp;first. If you have v22 LTS already, you&#8217;re good to go. If you have a different version and need to work with multiple SPFx versions across different projects, consider using&nbsp;<strong>Node Version Manager (NVM)</strong>&nbsp;— more on that later.</p>
</blockquote>



<p>Read <a href="https://www.spguides.com/create-modal-popup-in-spfx/">How to Create a Modal Popup in SPFx</a></p>



<h2 class="wp-block-heading" id="step-2-install-a-code-editor">Step 2: Install a Code Editor</h2>



<p>Next, you need a code editor to write your TypeScript and configuration files. You can use any editor you&#8217;re comfortable with — SPFx has no requirement here.</p>



<p>That said, I <span style="box-sizing: border-box; margin: 0px; padding: 0px;">recommended using</span>&nbsp;Visual Studio Code (VS Code)&nbsp;for all its examples, and I&#8217;d strongly recommend it for beginners and experienced developers alike. It&#8217;s free, cross-platform, has a built-in terminal (which is super handy for running SPFx commands without switching windows), and has excellent extension support.</p>



<p>If you prefer&nbsp;<strong>WebStorm</strong>&nbsp;from JetBrains, that&#8217;s also a perfectly valid choice.</p>



<p>Download VS Code from&nbsp;<code>code.visualstudio.com</code>&nbsp;and install it for your platform.</p>



<h2 class="wp-block-heading" id="step-3-install-the-development-toolchain-prerequis">Step 3: Install the Development Toolchain Prerequisites</h2>



<p>This is the most important step of the entire setup. SPFx&#8217;s build and development toolchain relies on several open-source tools. While most project-level dependencies install automatically when you create a new project, there are&nbsp;<strong>three tools you need to install globally on your machine</strong>:</p>



<ol class="wp-block-list">
<li><strong>Heft</strong>&nbsp;— the build tool (new in SPFx v1.22)</li>



<li><strong>Yeoman (yo)</strong>&nbsp;— the project scaffolding wizard</li>



<li><strong>Yeoman SharePoint Generator</strong>&nbsp;— the SPFx-specific plugin for Yeoman</li>
</ol>



<p>Microsoft gives you a helpful shortcut — you can install all three with a single command:</p>



<pre class="wp-block-preformatted">npm install @rushstack/heft yo @microsoft/generator-sharepoint --global</pre>



<p>Or, if you prefer to install them one at a time and understand what each does, here&#8217;s the breakdown:</p>



<h3 class="wp-block-heading" id="install-heft">Install Heft</h3>



<p><strong>Heft</strong>&nbsp;is the new build toolchain introduced with SPFx v1.22. It replaces Gulp as the primary build engine and orchestrates other popular tools like TypeScript, ESLint, Jest, Webpack, and API Extractor under the hood. If you&#8217;re familiar with task runners like Gulp or Grunt, Heft plays a very similar role — but it&#8217;s designed for large-scale, consistent use across many projects.</p>



<p>To install Heft globally:</p>



<pre class="wp-block-preformatted">npm install @rushstack/heft --global</pre>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p><strong>Why install it globally?</strong>&nbsp;Technically, Heft doesn&#8217;t need to be installed globally — it&#8217;s included inside each project you create. But installing it globally makes it much easier to run Heft commands directly from your terminal without navigating into each project&#8217;s local binaries. The Microsoft documentation recommends global installation for this reason.</p>
</blockquote>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p><strong>Important — What if you&#8217;re on SPFx v1.21.x or older?</strong>&nbsp;You should&nbsp;<strong>not</strong>&nbsp;install Heft. Older projects use the Gulp-based toolchain, and their setup guide tells you to install&nbsp;<code>gulp-cli</code>&nbsp;globally instead. The tools are different, the commands are different, and mixing them up will cause confusion.</p>
</blockquote>



<h3 class="wp-block-heading" id="install-yeoman">Install Yeoman</h3>



<p><strong>Yeoman (yo)</strong>&nbsp;is a project scaffolding tool. It asks you a series of questions in an interactive wizard and then automatically generates a complete, correctly structured SPFx project for you — with all the right folders, TypeScript configuration, build settings, and boilerplate code already in place.</p>



<p>To install Yeoman globally:</p>



<pre class="wp-block-preformatted">npm install yo --global</pre>



<h3 class="wp-block-heading" id="install-the-yeoman-sharepoint-generator">Install the Yeoman SharePoint Generator</h3>



<p>The&nbsp;<strong>Yeoman SharePoint Generator</strong>&nbsp;is the SPFx-specific plugin that powers the wizard when you create a new project. Without it, Yeoman wouldn&#8217;t know how to scaffold an SPFx solution. It&#8217;s what makes Yeoman ask you things like &#8220;What type of component do you want to create?&#8221; and &#8220;Which JavaScript framework do you want to use?&#8221;</p>



<p>To install it globally:</p>



<pre class="wp-block-preformatted">npm install @microsoft/generator-sharepoint --global</pre>



<p>Check out <a href="https://www.spguides.com/bind-sharepoint-list-items-to-spfx-fluent-ui-react-dropdown/">Bind SharePoint List Items to SPFx Fluent UI React Dropdown</a></p>



<h2 class="wp-block-heading" id="step-4-install-a-modern-web-browser">Step 4: Install a Modern Web Browser</h2>



<p>You&#8217;ll need a modern web browser for testing and debugging your solutions in the SharePoint workbench. The Microsoft documentation recommends any of the following:</p>



<ul class="wp-block-list">
<li><strong>Microsoft Edge</strong></li>



<li><strong>Google Chrome</strong></li>



<li><strong>Firefox</strong></li>
</ul>



<p>All three are excellent choices with strong developer tools. Avoid Internet Explorer — it&#8217;s not supported for SPFx development.</p>



<h2 class="wp-block-heading" id="step-5-trust-the-self-signed-developer-certificate">Step 5: Trust the Self-Signed Developer Certificate</h2>



<p>When you test an SPFx solution locally, it runs on a local development server that uses&nbsp;<strong>HTTPS by default</strong>. This local server uses a&nbsp;<strong>self-signed SSL certificate</strong>&nbsp;— a certificate that isn&#8217;t issued by a trusted certificate authority. By default, your operating system and browser will not trust this certificate, which means you&#8217;ll get a security warning or blocked page when you try to load the workbench.</p>



<p>To fix this, you need to register the certificate as trusted on your machine. SPFx includes a built-in Heft command to do this.</p>



<h3 class="wp-block-heading" id="when-to-run-this-command">When to Run This Command</h3>



<p>You can run this command either now or after you create your first project. I recommend running this command after you create your first project. The command needs to be run from inside an SPFx project folder (after running&nbsp;<code>npm install</code>&nbsp;to install the project dependencies), so if you haven&#8217;t created a project yet, you can come back to this step.</p>



<p>Once you have a project created and&nbsp;<code>npm install</code>&nbsp;has been run inside the project root, execute:</p>



<pre class="wp-block-preformatted">heft trust-dev-cert</pre>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p><strong>Note for SPFx v1.21.x and older (Gulp-based projects):</strong>&nbsp;The equivalent command in the old toolchain was&nbsp;<code>gulp trust-dev-cert</code>. If you&#8217;re working on a legacy project, use the Gulp command instead.</p>
</blockquote>



<p>You only need to do this&nbsp;<strong>once per machine</strong>. After the certificate is trusted, all future SPFx projects on the same machine will work without needing to repeat this step.</p>



<p>Check out <a href="https://www.spguides.com/customize-sharepoint-list-command-bar-download-button-using-spfx-extension/">Customize SharePoint List Command Bar Download Button Using SPFx Extension</a></p>



<h2 class="wp-block-heading" id="step-6-set-the-spfxservetenantdomain-environment-v">Step 6: Set the SPFX_SERVE_TENANT_DOMAIN Environment Variable (Optional but Recommended)</h2>



<p>Starting with&nbsp;<strong>SPFx v1.17</strong>, the hosted workbench URL used during development was changed to use a dynamic placeholder. If you open a project&#8217;s&nbsp;<code>./config/serve.json</code>&nbsp;file, you&#8217;ll see this:</p>



<pre class="wp-block-preformatted">{<br>  "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json",<br>  "port": 4321,<br>  "https": true,<br>  "initialPage": "https://{tenantDomain}/_layouts/workbench.aspx"<br>}</pre>



<p>Notice the&nbsp;<code>{tenantDomain}</code>&nbsp;placeholder. When you run the serve command to test your solution, SPFx automatically replaces this placeholder with the value of an environment variable called&nbsp;<code>SPFX_SERVE_TENANT_DOMAIN</code>&nbsp;on your system.</p>



<p>This is useful because it means you configure your SharePoint tenant domain&nbsp;<strong>once</strong>&nbsp;at the operating system level, and every SPFx project you create picks it up automatically. You won&#8217;t need to manually edit the&nbsp;<code>serve.json</code>&nbsp;file in every project.</p>



<p>The variable supports not just the tenant domain but also full site URLs in other serve configurations — for example, if you&#8217;re building a Field Customizer and have a&nbsp;<code>pageUrl</code>&nbsp;in your serve config with a&nbsp;<code>{tenantDomain}</code>&nbsp;placeholder, it will be replaced the same way.</p>



<h3 class="wp-block-heading" id="how-to-set-it">How to Set It</h3>



<p><strong>On Windows:</strong></p>



<ol class="wp-block-list">
<li>Press&nbsp;<code>Win + S</code>&nbsp;and search for &#8220;Environment Variables&#8221;</li>



<li>Click &#8220;Edit the system environment variables&#8221;</li>



<li>Under &#8220;User variables&#8221;, click &#8220;New&#8221;</li>



<li>Set the&nbsp;<strong>Variable name</strong>&nbsp;to&nbsp;<code>SPFX_SERVE_TENANT_DOMAIN</code></li>



<li>Set the&nbsp;<strong>Variable value</strong>&nbsp;to your SharePoint tenant domain, e.g.,&nbsp;<code>contoso.sharepoint.com</code></li>



<li>Click OK and restart your terminal</li>
</ol>



<p><strong>On macOS/Linux:</strong><br>Add the following line to your shell profile file (<code>~/.zshrc</code>&nbsp;for Zsh,&nbsp;<code>~/.bashrc</code>&nbsp;for Bash):</p>



<pre class="wp-block-preformatted">export SPFX_SERVE_TENANT_DOMAIN=contoso.sharepoint.com</pre>



<p>Then restart your terminal or run&nbsp;<code>source ~/.zshrc</code>&nbsp;to apply the change immediately.</p>



<p>Read <a href="https://www.spguides.com/spfx-upload-file-to-sharepoint-document-library-with-metadata/">Upload File to SharePoint Document Library With Metadata in SPFx</a></p>



<h2 class="wp-block-heading" id="quick-verification-are-all-your-tools-installed">Quick Verification: Are All Your Tools Installed?</h2>



<p>Once you&#8217;ve completed the steps above, you can verify everything is in place by running this command in your terminal:</p>



<pre class="wp-block-preformatted">npm list --global --depth=0</pre>



<p>This lists all globally installed npm packages. You should see:</p>



<ul class="wp-block-list">
<li><code>@rushstack/heft</code></li>



<li><code>yo</code></li>



<li><code>@microsoft/generator-sharepoint</code></li>
</ul>



<p>If any of these are missing, re-run the install command for that specific package.</p>



<h2 class="wp-block-heading">Develop Your First Client-Side Web Part using SPFx</h2>



<p>With all the tools installed and your developer certificate trusted, your machine is completely set up for SharePoint Framework development. The next step is scaffolding your very first SPFx project. Now we will create our first SPFx client-side web part.</p>



<p>You can also create a folder:</p>



<pre class="wp-block-code"><code>md SPFxHeftProject
cd SPFxHeftProject</code></pre>



<p>Open your terminal, navigate to the folder where you&#8217;d like to create the project, and run:</p>



<pre class="wp-block-code"><code>yo @microsoft/sharepoint</code></pre>



<p>Yeoman will launch an interactive wizard. It will ask you for your solution name, the type of component you want to create (web part, extension, etc.), and your preferred JavaScript framework.</p>



<p id="block-1b499e8e-4fdf-47f2-b5ec-86ae465ee8f2">When prompted:</p>



<ul id="block-8d3f9afe-b686-4387-b1cd-5a9271cf39ae" class="wp-block-list">
<li>What is your solution name? <strong>sp-fx-heft-project</strong></li>



<li>Which type of client-side component to create? <strong>WebPart</strong></li>



<li>Add new Web part to solution sp-fx-heft-project.</li>



<li>What is your Web part name? <strong>HeftProject</strong></li>



<li>Which template would you like to use? <strong>React</strong></li>
</ul>



<p>Here is a screenshot for your reference.</p>


<div class="wp-block-image">
<figure class="aligncenter" id="block-a186e85a-90a8-4ed6-8c1a-b897aabdd70b"><img decoding="async" src="https://www.spguides.com/wp-content/uploads/2026/04/setup-spfx-environment-with-heft-in-sharepoint-1024x712.avif" alt="setup spfx environment with heft in sharepoint" title="setup spfx environment with heft in sharepoint"></figure></div>


<p><strong>Understand What Just Changed</strong></p>



<p id="block-7fb2b5b8-1ad1-4d37-be71-85be9588410e">When the generator runs, it defaults to the Heft-based toolchain. You&#8217;ll notice immediately that the generated project looks slightly different from older projects:</p>



<ul id="block-9c417f2a-b3b9-4c81-9215-db8eac9be4ed" class="wp-block-list">
<li>There&#8217;s no&nbsp;<code>gulpfile.js</code></li>



<li>There&#8217;s a&nbsp;<code>./config/rig.json</code>&nbsp;file</li>



<li>There&#8217;s a&nbsp;<code>./config/sass.json</code>&nbsp;that extends the rig configuration</li>



<li>There&#8217;s a&nbsp;<code>./config/typescript.json</code>&nbsp;for TypeScript plugin settings</li>



<li>The&nbsp;<code>package.json</code>&nbsp;scripts call&nbsp;<code>heft</code>&nbsp;instead of&nbsp;<code>gulp</code></li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter" id="block-9905c07d-8b7c-4d8f-a3fa-626b97ce31a1"><img decoding="async" src="https://www.spguides.com/wp-content/uploads/2026/04/setting-up-a-new-spfx-project-with-heft.avif" alt="setting up a new spfx project with heft" title="setting up a new spfx project with heft"></figure></div>


<p id="block-b34caf17-6b9f-4829-adf7-d506de2d0002">This confirms you’re using the new Heft-based build system. This is the key difference compared to older SPFx projects. The Gulf file is also not there.</p>



<p id="block-05d37f3b-8752-42ca-9869-041c4e9a7646">Your new&nbsp;<code>package.json</code>&nbsp;scripts section will look like this:</p>



<pre id="block-51b3f370-676a-41df-a1f1-d0111a4aa6d4" class="wp-block-code"><code>  "scripts": {<br>    "build": "heft test --clean --production &amp;&amp; heft package-solution --production",<br>    "start": "heft start --clean",<br>    "clean": "heft clean",<br>    "eject-webpack": "heft eject-webpack"<br>  }</code></pre>



<p>You can refer to the screenshot below:</p>


<div class="wp-block-image">
<figure class="aligncenter" id="block-70817434-b848-48a3-ace4-1ca8bd3f839a"><img decoding="async" src="https://www.spguides.com/wp-content/uploads/2026/04/heft-set-up-a-new-spfx-project-1024x555.avif" alt="heft set up a new spfx project" title="heft set up a new spfx project"></figure></div>


<p id="block-dfe39f90-01a6-43e2-8644-31a4f8b45383">Notice a couple of things here. First, the&nbsp;<code>bundle</code>&nbsp;task is gone — in Heft,&nbsp;<code>build</code>&nbsp;handles both building and bundling in one step. Second, there&#8217;s a brand new&nbsp;<code>deploy</code>&nbsp;command (<code>heft dev-deploy</code>) that didn&#8217;t exist in the Gulp world.</p>



<p>After&nbsp;<code>npm install</code>&nbsp;finishes, if you haven&#8217;t already, run:</p>



<pre class="wp-block-preformatted">heft trust-dev-cert</pre>



<h3 class="wp-block-heading">Update the Workbench URL</h3>



<p>Before testing your web part, make sure to update the <code>initialPage</code> in the <code>serve.json</code> file. Replace <code>{tenantDomain}</code> with your actual SharePoint tenant URL so the local workbench opens correctly in your environment. You can check the screenshot below.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f2f2f3" data-has-transparency="false" style="--dominant-color: #f2f2f3;" loading="lazy" decoding="async" width="1024" height="501" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/run-spfx-webpart-locally-1024x501.avif" alt="run spfx webpart locally" class="wp-image-134005 not-transparent" title="run spfx webpart locally" srcset="https://www.spguides.com/wp-content/uploads/2026/04/run-spfx-webpart-locally-1024x501.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/run-spfx-webpart-locally-300x147.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/run-spfx-webpart-locally-768x376.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/run-spfx-webpart-locally.avif 1414w" /></figure></div>


<h3 class="wp-block-heading">Run the Project</h3>



<p>Instead of the old Gulp command:</p>



<pre class="wp-block-preformatted">gulp serve</pre>



<p>You now use:</p>



<pre class="wp-block-preformatted">npm run start<br># or<br>heft start --clean</pre>



<p>After running the command, the local workbench will open in your browser. At this point, you may see a prompt asking <strong>“Allow debug scripts?”</strong>. This is expected when running SPFx solutions locally, as the page is loading scripts from your development machine.</p>



<p>Since you are testing your own code, you can safely click <strong>“Load debug scripts”</strong> to proceed and continue testing your web part.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="d4d5d8" data-has-transparency="false" style="--dominant-color: #d4d5d8;" loading="lazy" decoding="async" width="976" height="430" sizes="(max-width: 976px) 100vw, 976px" src="https://www.spguides.com/wp-content/uploads/2026/04/run-spfx-heft-configured-webpart-locally.avif" alt="run spfx heft configured webpart locally" class="wp-image-134008 not-transparent" title="run spfx heft configured webpart locally" srcset="https://www.spguides.com/wp-content/uploads/2026/04/run-spfx-heft-configured-webpart-locally.avif 976w, https://www.spguides.com/wp-content/uploads/2026/04/run-spfx-heft-configured-webpart-locally-300x132.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/run-spfx-heft-configured-webpart-locally-768x338.avif 768w" /></figure></div>


<p>Then, the page below will open. Click the + Add icon and find your web part. You can either search for your web part name, and it will display.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f3f0e9" data-has-transparency="false" style="--dominant-color: #f3f0e9;" loading="lazy" decoding="async" width="1024" height="530" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/deploy-spfx-webpart-to-sharepoint-online-1024x530.avif" alt="deploy spfx webpart to sharepoint online" class="wp-image-134009 not-transparent" title="deploy spfx webpart to sharepoint online" srcset="https://www.spguides.com/wp-content/uploads/2026/04/deploy-spfx-webpart-to-sharepoint-online-1024x530.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/deploy-spfx-webpart-to-sharepoint-online-300x155.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/deploy-spfx-webpart-to-sharepoint-online-768x398.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/deploy-spfx-webpart-to-sharepoint-online.avif 1302w" /></figure></div>


<p>Once you’re confident that your SPFx web part is working as expected, the next step is to prepare it for deployment. Run the command below to create the package, and once it completes, you’ll find the <code>.sppkg</code> file inside the <code>sharepoint</code> folder, as shown in the image below.</p>



<pre class="wp-block-code"><code>heft package-solution --production</code></pre>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="798ba4" data-has-transparency="false" style="--dominant-color: #798ba4;" loading="lazy" decoding="async" width="1024" height="524" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/add-custom-web-part-to-sharepoint-online-1024x524.avif" alt="add custom web part to sharepoint online" class="wp-image-134013 not-transparent" title="add custom web part to sharepoint online" srcset="https://www.spguides.com/wp-content/uploads/2026/04/add-custom-web-part-to-sharepoint-online-1024x524.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/add-custom-web-part-to-sharepoint-online-300x153.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/add-custom-web-part-to-sharepoint-online-768x393.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/add-custom-web-part-to-sharepoint-online-1536x785.avif 1536w, https://www.spguides.com/wp-content/uploads/2026/04/add-custom-web-part-to-sharepoint-online.avif 1776w" /></figure></div>


<p>Now upload the generated <code>.sppkg</code> file to your <a href="https://www.spguides.com/sharepoint-online-app-catalog/" target="_blank" rel="noreferrer noopener">tenant app catalog</a> or site collection app catalog. The deployment process remains the same as before, so you can follow the usual steps you’ve already used for deploying SPFx solutions.</p>



<h2 class="wp-block-heading" id="the-building-blocks-actions-phases-tasks-and-rigs">The Building Blocks: Actions, Phases, Tasks, and Rigs</h2>



<p>Now you need to understand how Heft organizes work. It has a specific vocabulary, and once you know these four terms, everything clicks.</p>



<ul class="wp-block-list">
<li><strong>Actions</strong>&nbsp;are the top-level commands you run from the CLI. For example,&nbsp;heft build,&nbsp;heft test,&nbsp;heft start. These are similar to the gulp tasks you used to have.</li>



<li><strong>Phases</strong>&nbsp;are logical groupings of work within an action. The&nbsp;<code>build</code>&nbsp;action might contain a&nbsp;<code>build</code>&nbsp;phase and a&nbsp;<code>test</code>&nbsp;phase.</li>



<li><strong>Tasks</strong>&nbsp;live inside phases. A task is a single unit of work — like compiling TypeScript, compiling Sass, or running ESLint.</li>



<li><strong>Rigs</strong>&nbsp;are the really clever part. A rig is a shared, reusable configuration package. Instead of every SPFx project carrying its own massive&nbsp;<code>heft.json</code>&nbsp;file with all the build logic, your project points to a rig package (<code>@microsoft/spfx-web-build-rig</code>) that contains all the default build configuration. Your project only defines what&#8217;s different from the default.</li>
</ul>



<p>In practice, a new SPFx v1.22 project has a very lean&nbsp;<code>./config/rig.json</code>&nbsp;file that looks like this:</p>



<pre class="wp-block-preformatted">{<br>  "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",<br>  "rigPackageName": "@microsoft/spfx-web-build-rig"<br>}</pre>



<p>That single file tells Heft:&nbsp;<em>&#8220;use all the build phases, tasks, and configurations defined in the SPFx rig package.&#8221;</em>&nbsp;Clean and simple.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="edf0f1" data-has-transparency="false" style="--dominant-color: #edf0f1;" loading="lazy" decoding="async" width="1024" height="280" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/setup-heft-in-sharepoint-framework-development-environment-1024x280.avif" alt="setup heft in sharepoint framework development environment" class="wp-image-134003 not-transparent" title="setup heft in sharepoint framework development environment" srcset="https://www.spguides.com/wp-content/uploads/2026/04/setup-heft-in-sharepoint-framework-development-environment-1024x280.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/setup-heft-in-sharepoint-framework-development-environment-300x82.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/setup-heft-in-sharepoint-framework-development-environment-768x210.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/setup-heft-in-sharepoint-framework-development-environment.avif 1366w" /></figure></div>


<p>Read <a href="https://www.spguides.com/spfx-property-pane-slide-manager-drag-drop/">Build a Custom Slides Manager in SPFx Web Part Property Pane</a></p>



<h2 class="wp-block-heading" id="heft-vs-gulp--a-clear-summary-for-beginners">Heft vs. Gulp — A Clear Summary</h2>



<p>Since this distinction causes a lot of confusion, let me summarize it clearly in one place:</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th></th><th><strong>Heft-Based Toolchain</strong></th><th><strong>Gulp-Based Toolchain (Legacy)</strong></th></tr></thead><tbody><tr><td><strong>SPFx versions</strong></td><td>v1.22.0 and above</td><td>v1.0 through v1.21.1</td></tr><tr><td><strong>Targets</strong></td><td>SharePoint Online (latest)</td><td>SharePoint Online + on-premises</td></tr><tr><td><strong>Global install</strong></td><td><code>@rushstack/heft</code></td><td><code>gulp-cli</code></td></tr><tr><td><strong>Local dev command</strong></td><td><code>heft serve</code>&nbsp;or&nbsp;<code>npm run serve</code></td><td><code>gulp serve</code></td></tr><tr><td><strong>Trust certificate</strong></td><td><code>heft trust-dev-cert</code></td><td><code>gulp trust-dev-cert</code></td></tr></tbody></table></figure>



<p>If you&#8217;ve been using the old toolchain, here&#8217;s the side-by-side comparison you need:</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>What you used to run (Gulp)</th><th>What you run now (Heft)</th></tr></thead><tbody><tr><td><code>gulp build</code></td><td><code>heft build</code></td></tr><tr><td><code>gulp bundle</code></td><td><em>(merged into&nbsp;<code>heft build</code>)</em></td></tr><tr><td><code>gulp clean</code></td><td><code>heft clean</code></td></tr><tr><td><code>gulp test</code></td><td><code>heft test</code></td></tr><tr><td><code>gulp serve</code></td><td><code>heft start</code></td></tr><tr><td><code>gulp package-solution</code></td><td><code>heft package-solution</code></td></tr><tr><td><code>gulp package-solution --ship</code></td><td><code>heft package-solution --production</code></td></tr><tr><td><code>gulp deploy-azure-storage</code></td><td><code>heft deploy-azure-storage</code></td></tr><tr><td><code>gulp trust-dev-cert</code></td><td><code>heft trust-dev-cert</code></td></tr><tr><td><em>(didn&#8217;t exist)</em></td><td><code>heft dev-deploy</code></td></tr></tbody></table></figure>



<p>If you&#8217;re starting fresh with SharePoint Online, always use the Heft-based toolchain. If you open someone else&#8217;s older project, check the SPFx version in&nbsp;<code>package.json</code>&nbsp;to know which toolchain applies.</p>



<h2 class="wp-block-heading" id="managing-multiple-spfx-versions-on-one-machine">Manage Multiple SPFx Versions on One Machine</h2>



<p>As you work on more projects over time, you may encounter situations where different projects require different SPFx versions — and therefore different Node.js versions. This is common when maintaining legacy solutions alongside new ones.</p>



<p>The Microsoft documentation suggests these approaches:</p>



<ul class="wp-block-list">
<li><strong>Node Version Manager (NVM):</strong>&nbsp;Install multiple Node.js versions side-by-side and switch between them with a single command. For macOS/Linux, use&nbsp;<code>nvm</code>. For Windows, use&nbsp;<code>nvm-windows</code>. This is the most practical approach for most developers.</li>



<li><strong>Virtual Machines:</strong>&nbsp;Run each environment in a completely isolated VM.</li>



<li><strong>Docker:</strong>&nbsp;Use Docker containers to fully isolate each environment.</li>
</ul>



<p>For most developers, NVM is the simplest solution. Once it&#8217;s installed, switching Node.js versions is as easy as typing&nbsp;<code>nvm use 22</code>&nbsp;or&nbsp;<code>nvm use 18</code>.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p>In this tutorial, I explained how to set up your SPFx development environment using the Heft toolchain step by step. The key things to remember are: use&nbsp;<strong>Node.js v22 LTS</strong>, install the&nbsp;<strong>Heft toolchain</strong>&nbsp;(not Gulp) since you&#8217;re on SPFx v1.22+, and trust your developer certificate before testing locally. If you ever switch machines or work with an older project that uses SPFx v1.21.1 or below, refer back to the Gulp-based setup guide — the commands and tools are different.</p>



<p>From here, every SPFx project you scaffold will follow the same pattern: run&nbsp;<code>yo @microsoft/sharepoint</code>, answer the wizard, run&nbsp;<code>npm install</code>, and start building.</p>



<p>Do let me know in the comments below if you face any issues.</p>



<p>You may also like the following tutorials:</p>



<ul class="wp-block-list">
<li><a href="https://www.spguides.com/build-a-sharepoint-folder-tree-view-using-spfx/">Build a SharePoint Folder Tree View Using SharePoint Framework (SPFx)</a></li>



<li><a href="https://www.spguides.com/sharepoint-framework-interview-questions-and-answers/">SharePoint Framework (SPFx) Interview Questions and Answers</a></li>



<li><a href="https://www.spguides.com/retrieve-sharepoint-list-items-using-sharepoint-framework/">Display SharePoint List Items in SPFx Web Part</a></li>



<li><a href="https://www.spguides.com/spfx-fluent-ui-react-dropdown/">Fluent UI React Dropdown in SharePoint Framework (SPFx)</a></li>
</ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Microsoft Teams Auto Mute When Joining a Meeting &#8211; How to Do</title>
		<link>https://www.spguides.com/microsoft-teams-auto-mute-on-join/</link>
		
		<dc:creator><![CDATA[Bijay Kumar]]></dc:creator>
		<pubDate>Mon, 27 Apr 2026 11:00:00 +0000</pubDate>
				<category><![CDATA[Microsoft Teams]]></category>
		<category><![CDATA[Microsoft Teams Auto Mute on Join]]></category>
		<guid isPermaLink="false">https://www.spguides.com/?p=131755</guid>

					<description><![CDATA[If you&#8217;ve ever joined a Teams meeting and found yourself muted without doing anything, you&#8217;re not alone. This is one of the most common things people get confused about in Microsoft Teams. And honestly, it makes sense — Teams has different muting behaviors depending on the situation, and some of those behaviors have changed in ... <a title="Microsoft Teams Auto Mute When Joining a Meeting &#8211; How to Do" class="read-more" href="https://www.spguides.com/microsoft-teams-auto-mute-on-join/" aria-label="Read more about Microsoft Teams Auto Mute When Joining a Meeting &#8211; How to Do">read more...</a>]]></description>
										<content:encoded><![CDATA[
<p>If you&#8217;ve ever joined a <a href="https://www.spguides.com/find-microsoft-teams-id/">Teams meeting</a> and found yourself muted without doing anything, you&#8217;re not alone. This is one of the most common things people get confused about in Microsoft Teams. And honestly, it makes sense — Teams has different muting behaviors depending on the situation, and some of those behaviors have changed in recent updates.</p>



<p>In this tutorial, I&#8217;ll walk you through why Teams auto-mutes you when you join, how to control it (to the extent you can), what meeting organizers can do, and how IT admins can configure it at scale.</p>



<h2 class="wp-block-heading" id="why-does-teams-mute-me-automatically">Why Does Teams Mute Me Automatically?</h2>



<p>Before jumping into fixes, it helps to understand why this happens. Teams doesn&#8217;t randomly decide to mute you — there&#8217;s a logic behind it.</p>



<p>Here are the main reasons you might join a meeting on mute:</p>



<ul class="wp-block-list">
<li><strong>More than 5 people are already in the meeting.</strong> Teams automatically mutes you when you join a meeting with 5 or more participants. This is intentional — it protects ongoing conversations from sudden background noise when a new person joins.</li>



<li><strong>The meeting organizer has restricted mic access.</strong>&nbsp;The organizer may have turned off mic permissions for attendees before or during the meeting.</li>



<li><strong>Your IT admin has set a policy.</strong>&nbsp;If you&#8217;re in a company environment, your admin may have enforced a policy that mutes attendees by default.</li>



<li><strong>Teams remembered your last state.</strong>&nbsp;In newer versions of Teams, it tries to remember how you joined your last meeting — muted or unmuted — and applies that preference going forward.</li>
</ul>



<p>So the first thing to figure out is:&nbsp;<em>why</em>&nbsp;are you being muted? The fix depends on the cause.</p>



<h2 class="wp-block-heading">Microsoft Teams Auto Mute On Join</h2>



<p>Let&#8217;s discuss 4 different methods!</p>



<h3 class="wp-block-heading" id="method-1-control-your-mute-state-on-the-pre-join-s">Method 1: Control Your Mute State on the Pre-Join Screen in Teams</h3>



<p>Every time you join a Teams meeting, you see a preview screen before entering — the one showing your camera feed and mic status. This is your best chance to control whether you join muted or unmuted.</p>



<p>Here&#8217;s what to do:</p>



<ol class="wp-block-list">
<li>Click the meeting link or join from your Teams <a href="https://www.spguides.com/power-apps-calendar-function/">calendar</a>.</li>



<li>On the pre-join screen, look at the microphone icon at the bottom.</li>



<li>If it shows as muted (crossed-out mic), click it to toggle it on before you join.</li>



<li>Click&nbsp;<strong>Join now</strong>.</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f3f2f3" data-has-transparency="false" style="--dominant-color: #f3f2f3;" loading="lazy" decoding="async" width="958" height="656" sizes="(max-width: 958px) 100vw, 958px" src="https://www.spguides.com/wp-content/uploads/2026/04/unmute-microsoft-teams-meeting-on-phone.avif" alt="unmute microsoft teams meeting on phone " class="wp-image-133787 not-transparent" title="unmute microsoft teams meeting on phone" srcset="https://www.spguides.com/wp-content/uploads/2026/04/unmute-microsoft-teams-meeting-on-phone.avif 958w, https://www.spguides.com/wp-content/uploads/2026/04/unmute-microsoft-teams-meeting-on-phone-300x205.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/unmute-microsoft-teams-meeting-on-phone-768x526.avif 768w" /></figure></div>


<p>The important thing here is:&nbsp;<strong>Teams remembers this setting.</strong>&nbsp;So if you join a meeting with your mic on, the next meeting should default to having your mic on too. If you keep joining muted, Teams will assume that&#8217;s your preference.</p>



<p><strong>Real example:</strong>&nbsp;Say you&#8217;ve been joining your daily standup on mute every morning. Teams has now &#8220;learned&#8221; that you prefer joining muted. To reset this, just unmute yourself on the pre-join screen the next time and join the meeting. Teams should remember that for future meetings.</p>



<blockquote class="wp-block-quote has-contrast-2-background-color has-background is-layout-flow wp-block-quote-is-layout-flow">
<p class="has-base-2-background-color has-background"><strong>Note:</strong>&nbsp;This only works if you&#8217;re the first 4 people in the meeting or close to it. If 5+ people are already in there, Teams will override your preference and mute you regardless — that&#8217;s the auto-mute rule kicking in.</p>
</blockquote>



<h3 class="wp-block-heading" id="method-2-check-if-teams-is-set-to-dont-use-audio">Method 2: Check If Teams Is Set to &#8220;Don&#8217;t Use Audio&#8221;</h3>



<p>This one catches a lot of people off guard. <span style="box-sizing: border-box; margin: 0px; padding: 0px;">If you&#8217;ve ever plugged in or unplugged a headset during a meeting, Teams may have silently switched your audio setting to <strong>&#8220;Don&#8217;t use audio,&#8221;</strong> so you join meetings without audio.</span> You&#8217;ll hear nothing, and your mic won&#8217;t work.</p>



<p>Here&#8217;s how to fix it:</p>



<ol class="wp-block-list">
<li>Start a new test meeting (you can use&nbsp;<strong>Meet now</strong>&nbsp;and join by yourself).</li>



<li>On the pre-join screen, look at the audio options — you might see it says&nbsp;<strong>&#8220;Don&#8217;t use audio&#8221;</strong>&nbsp;instead of&nbsp;<strong>&#8220;Computer audio.&#8221;</strong></li>



<li>Click that and switch it to&nbsp;<strong>Computer audio</strong>.</li>



<li>Join the meeting and then leave.</li>
</ol>



<p>Teams remembers this change, and your next real meeting should work properly.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f4f3f4" data-has-transparency="false" style="--dominant-color: #f4f3f4;" loading="lazy" decoding="async" width="1024" height="435" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/allow-mic-for-attendees-teams-1024x435.avif" alt="allow mic for attendees teams" class="wp-image-133792 not-transparent" title="allow mic for attendees teams" srcset="https://www.spguides.com/wp-content/uploads/2026/04/allow-mic-for-attendees-teams-1024x435.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/allow-mic-for-attendees-teams-300x127.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/allow-mic-for-attendees-teams-768x326.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/allow-mic-for-attendees-teams.avif 1506w" /></figure></div>


<h3 class="wp-block-heading" id="method-3-the-hard-truth-about-the-always-join-mute">Method 3: The Hard Truth About the &#8220;Always Join Muted&#8221; Toggle</h3>



<p><span style="box-sizing: border-box; margin: 0px; padding: 0px;">If you&#8217;re looking for a setting somewhere in Teams preferences that says <em>&#8220;Always join meetings muted&#8221;</em> or <em>&#8220;Always join meetings unmuted,&#8221;</em> it doesn&#8217;t exist anymore.</span></p>



<p>Microsoft removed this user-configurable toggle in a recent Teams update. Previously, you could find it under <strong>Settings > Devices</strong>, but that option is no longer available in current versions of Teams. The reasoning from Microsoft is that Teams now dynamically handles muting based on meeting size and remembered preferences.</p>



<p>So if a colleague tells you &#8220;just go to Settings and toggle it,&#8221; they&#8217;re probably thinking of an older version of Teams. The current behavior relies on:</p>



<ul class="wp-block-list">
<li>The 5-participant threshold rule</li>



<li>What you did on the pre-join screen last time</li>



<li>Any policies your admin or meeting organizer has set</li>
</ul>



<h3 class="wp-block-heading" id="method-4-for-meeting-organizers--control-how-atten">Method 4: For Meeting Organizers — Control How Attendees Join</h3>



<p>If you&#8217;re running the meeting, you have much more control over this. You can decide whether attendees join muted, whether they can unmute themselves, or whether they&#8217;re completely mic-disabled.</p>



<h4 class="wp-block-heading" id="option-a-set-it-before-the-meeting">Option A: Set It Before the Meeting</h4>



<ol class="wp-block-list">
<li>Open Teams and go to your&nbsp;<strong>Calendar</strong>.</li>



<li>Create or open your <a href="https://www.spguides.com/send-a-microsoft-teams-invite/">scheduled meeting</a>.</li>



<li>Click&nbsp;<strong>Meeting options</strong>&nbsp;(you&#8217;ll see this link in the meeting details).</li>



<li>In the Meeting Options window:
<ul class="wp-block-list">
<li>Set&nbsp;<strong>&#8220;Who can present?&#8221;</strong>&nbsp;to&nbsp;<strong>&#8220;Only me&#8221;</strong>&nbsp;or&nbsp;<strong>&#8220;Only organizers and co-organizers.&#8221;</strong>&nbsp;This gives everyone else the&nbsp;<em>Attendee</em>&nbsp;role.</li>



<li>Set&nbsp;<strong>&#8220;Allow mic for attendees&#8221;</strong>&nbsp;to&nbsp;<strong>Off</strong>&nbsp;if you want everyone to join muted and stay muted until you let them speak.</li>
</ul>
</li>
</ol>



<h4 class="wp-block-heading" id="option-b-control-muting-during-the-meeting">Option B: Control Muting During the Meeting</h4>



<p>Even if you didn&#8217;t set it up beforehand, you can manage mutes live:</p>



<ul class="wp-block-list">
<li>To&nbsp;<strong>mute one person</strong>: Go to the&nbsp;<strong>People</strong>&nbsp;panel, hover over their name, click the three dots, and select&nbsp;<strong>Mute participant</strong>.</li>



<li>To&nbsp;<strong>mute everyone at once</strong>: In the&nbsp;<strong>People</strong>&nbsp;panel, click&nbsp;<strong>Mute all</strong>&nbsp;next to &#8220;In the meeting.&#8221;</li>



<li>To&nbsp;<strong>disable mics entirely</strong>&nbsp;(so attendees can&#8217;t unmute themselves): Go to meeting controls &gt;&nbsp;<strong>More options</strong>&nbsp;&gt;&nbsp;<strong>Manage audio and video</strong>&nbsp;&gt; toggle on&nbsp;<strong>Disable mic for attendees</strong>.</li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="ebedee" data-has-transparency="false" style="--dominant-color: #ebedee;" loading="lazy" decoding="async" width="956" height="610" sizes="(max-width: 956px) 100vw, 956px" src="https://www.spguides.com/wp-content/uploads/2026/04/how-to-control-attendees-in-microsoft-teams.avif" alt="how to control attendees in microsoft teams" class="wp-image-133789 not-transparent" title="how to control attendees in microsoft teams" srcset="https://www.spguides.com/wp-content/uploads/2026/04/how-to-control-attendees-in-microsoft-teams.avif 956w, https://www.spguides.com/wp-content/uploads/2026/04/how-to-control-attendees-in-microsoft-teams-300x191.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/how-to-control-attendees-in-microsoft-teams-768x490.avif 768w" /></figure></div>


<p>This last option is what Microsoft calls &#8220;hard mute&#8221; — it&#8217;s great for large webinars, training sessions, or town halls where you only want specific people speaking.</p>



<p><strong>Real example:</strong>&nbsp;You&#8217;re hosting a company-wide all-hands with 200 attendees. Before the meeting, you set &#8220;Allow mic for attendees&#8221; to Off. Everyone joins muted and can&#8217;t unmute. If someone wants to ask a question, they use the&nbsp;<strong>Raise Hand</strong>&nbsp;feature, and you selectively let them speak.</p>



<h2 class="wp-block-heading" id="quick-tip-use-ctrl--spacebar-to-temporarily-unmute">Quick Tip: Use CTRL + Spacebar to Temporarily Unmute</h2>



<p>Here&#8217;s a small but really useful thing that not many people know. If you&#8217;re in a meeting and you&#8217;re muted, you don&#8217;t always have to click the mic button to say something quickly.</p>



<p>Just hold&nbsp;<strong>CTRL + Spacebar</strong>&nbsp;(on Windows) while you&#8217;re talking. The moment you release it, you go back on mute. It&#8217;s like a push-to-talk button.</p>



<p>This is super handy when you&#8217;re in a large meeting where you&#8217;re mostly listening but need to say something briefly without having to toggle mute on and off repeatedly.</p>



<h2 class="wp-block-heading" id="when-auto-mute-is-actually-a-good-thing">When Auto-Mute Is Actually a Good Thing in Teams</h2>



<p>I know this whole tutorial started because auto-mute felt annoying. But honestly, auto-muting when you join a large meeting is one of the smarter things Teams does.</p>



<p>Think about it — if you join a meeting with 20 people and your mic is live, everyone hears your keyboard clicks, your dog barking, your chair squeaking. The 5-person threshold rule exists specifically to prevent that kind of disruption.</p>



<p>The real problem is when Teams mutes you <span style="box-sizing: border-box; margin: 0px; padding: 0px;">during a small one-on-one call, or when you <em>want</em> to join unmuted but can&#8217;t figure out how to chan</span>ge it. That&#8217;s the legitimate frustration — and hopefully the methods above help you deal with it.</p>



<h2 class="wp-block-heading" id="summary-of-when-teams-auto-mutes-you">Summary of When Teams Auto-Mutes You</h2>



<figure class="wp-block-table is-style-stripes"><table class="has-fixed-layout"><thead><tr><th>Situation</th><th>What Happens</th><th>Can You Override It?</th></tr></thead><tbody><tr><td>Joining a meeting with 5+ people already in it</td><td>Auto-muted</td><td>Only on pre-join screen</td></tr><tr><td>Meeting organizer disabled mic for attendees</td><td>Muted, can&#8217;t unmute</td><td>No — organizer controls this</td></tr><tr><td>IT admin policy enforced</td><td>Muted by policy</td><td>No — contact your admin</td></tr><tr><td>Your last meeting state was muted</td><td>Joined muted by default</td><td>Yes — unmute on pre-join screen</td></tr><tr><td>Audio set to &#8220;Don&#8217;t use audio&#8221;</td><td>No audio at all</td><td>Yes — switch to Computer audio</td></tr></tbody></table></figure>



<h2 class="wp-block-heading">Conclusion</h2>



<p>I hope you found this article helpful. In this guide, I explained why Microsoft Teams mutes you when you join a meeting. I also shared different methods to control your mute settings. These steps are simple and easy to follow.</p>



<p>If you are facing the same issue, try the steps in this article. They can help you manage your audio better during meetings. This will make your meetings smoother and less stressful.</p>



<p>Also, you may like:</p>



<ul class="wp-block-list">
<li><a href="https://www.spguides.com/add-new-attendee-to-meeting-without-email-others-power-automate/">Add a New Attendee to a Meeting Without Email Others Using Power Automate</a></li>



<li><a href="https://www.spguides.com/download-attendance-list-from-microsoft-teams-meeting/">Download Attendance List From Microsoft Teams After a Meeting</a></li>



<li><a href="https://www.spguides.com/turn-on-translate-in-microsoft-teams/">3 Best Ways to Turn On Translate in Microsoft Teams Meeting</a></li>



<li><a href="https://www.spguides.com/microsoft-teams-vs-zoom/">Microsoft Teams vs Zoom</a></li>
</ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Reschedule or Cancel a Teams Meeting in Microsoft Teams [Step By Step]</title>
		<link>https://www.spguides.com/reschedule-teams-meeting-in-microsoft-teams/</link>
		
		<dc:creator><![CDATA[Bijay Kumar]]></dc:creator>
		<pubDate>Sat, 25 Apr 2026 11:00:00 +0000</pubDate>
				<category><![CDATA[Microsoft Teams]]></category>
		<category><![CDATA[Reschedule or Cancel a Teams Meeting in Microsoft Teams]]></category>
		<guid isPermaLink="false">https://www.spguides.com/?p=131688</guid>

					<description><![CDATA[Let&#8217;s be honest — plans change. A client pushes back, your calendar fills up, or the topic just isn&#8217;t ready to discuss yet. Whatever the reason, you need to reschedule or cancel a Teams meeting, and you want to do it quickly without confusing your attendees. The good news? Microsoft Teams makes this pretty straightforward ... <a title="How to Reschedule or Cancel a Teams Meeting in Microsoft Teams [Step By Step]" class="read-more" href="https://www.spguides.com/reschedule-teams-meeting-in-microsoft-teams/" aria-label="Read more about How to Reschedule or Cancel a Teams Meeting in Microsoft Teams [Step By Step]">read more...</a>]]></description>
										<content:encoded><![CDATA[
<p>Let&#8217;s be honest — plans change. A client pushes back, your calendar fills up, or the topic just isn&#8217;t ready to discuss yet. Whatever the reason, you need to reschedule or cancel a Teams meeting, and you want to do it quickly without confusing your attendees.</p>



<p>The good news? <a href="https://www.spguides.com/microsoft-teams-vs-zoom/">Microsoft Teams </a>makes this pretty straightforward once you know where to look. In this tutorial, I&#8217;ll walk you through every method — from the quick drag-and-drop trick to handling recurring meetings — so you&#8217;re covered no matter what situation you&#8217;re in.</p>



<h2 class="wp-block-heading" id="what-you-need-to-know-first">What You Need to Know First</h2>



<p>Before we jump in, here&#8217;s one important thing to keep in mind:&nbsp;<strong>only the meeting organizer can reschedule or cancel a meeting.</strong>&nbsp;If you were just invited to a meeting and you need it changed, you&#8217;ll have to reach out to whoever set it up.</p>



<p>Also, when you reschedule or cancel a meeting in Teams, all attendees automatically get a notification. You don&#8217;t need to send a separate email. Teams takes care of that for you.</p>



<h2 class="wp-block-heading" id="how-to-reschedule-a-teams-meeting">How to Reschedule a Teams Meeting</h2>



<p>There are a few different ways to do this, depending on how fast you want to move and how many changes you need to make.</p>



<h3 class="wp-block-heading" id="method-1-the-quick-drag-and-drop-fastest-way">Method 1: The Quick Drag-and-Drop (Fastest Way)</h3>



<p>This is hands down the quickest method if you just need to shift a meeting to a nearby time slot on the same day or within the same week.</p>



<p>Here&#8217;s how to do it:</p>



<ol class="wp-block-list">
<li>Open&nbsp;<strong>Microsoft Teams</strong>&nbsp;and click on&nbsp;<a href="https://www.spguides.com/add-calendar-list-in-the-modern-sharepoint-online-site-page/">Calendar&nbsp;</a>in the left sidebar.</li>



<li>Find the meeting you want to reschedule.</li>



<li>Click and hold the meeting, then&nbsp;<strong>drag it to the new time slot</strong>&nbsp;on your calendar.</li>



<li>Drop it in place.</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f7f7f8" data-has-transparency="false" style="--dominant-color: #f7f7f8;" loading="lazy" decoding="async" width="1096" height="726" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/reschedule-teams-meeting.gif" alt="reschedule teams meeting" class="wp-image-134023 not-transparent" title="reschedule teams meeting"></figure></div>


<p>The moment you drop it, Teams will show you a pop-up telling you whether your attendees are available at the new time. That&#8217;s a genuinely useful feature — you can check availability without opening the Scheduling Assistant separately.</p>



<ol start="5" class="wp-block-list">
<li>If everything looks good, click&nbsp;<strong>Send</strong>.</li>
</ol>



<p>That&#8217;s it. All attendees get notified automatically with the new time.</p>



<blockquote class="wp-block-quote has-contrast-2-background-color has-background is-layout-flow wp-block-quote-is-layout-flow">
<p class="has-base-2-background-color has-background"><strong>Example:</strong>&nbsp;Say you have a 2 PM project sync on Wednesday and you need to push it to 4 PM the same day. Just drag it down on the calendar view and drop it at the 4 PM slot. Done in under 10 seconds.</p>
</blockquote>



<p><strong>One limitation here:</strong>&nbsp;Drag-and-drop only works within the same week view. If you need to move a meeting to a different week, use the method below.</p>



<h3 class="wp-block-heading" id="method-2-edit-the-meeting-details-most-control">Method 2: Edit the Meeting Details (Most Control)</h3>



<p>This is the method to use when you need to change the date, time, add or remove attendees, or update the meeting description all at once.</p>



<ol class="wp-block-list">
<li>Go to&nbsp;<strong>Calendar</strong>&nbsp;in Teams.</li>



<li>Click on the meeting you want to change — this opens a summary panel on the right side.</li>



<li>Click&nbsp;<strong>Edit</strong>&nbsp;(pencil icon).</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f5f5f7" data-has-transparency="false" style="--dominant-color: #f5f5f7;" loading="lazy" decoding="async" width="744" height="470" sizes="(max-width: 744px) 100vw, 744px" src="https://www.spguides.com/wp-content/uploads/2026/04/how-to-reschedule-teams-meeting-in-outlook.avif" alt="how to reschedule teams meeting in outlook" class="wp-image-134025 not-transparent" title="how to reschedule teams meeting in outlook" srcset="https://www.spguides.com/wp-content/uploads/2026/04/how-to-reschedule-teams-meeting-in-outlook.avif 744w, https://www.spguides.com/wp-content/uploads/2026/04/how-to-reschedule-teams-meeting-in-outlook-300x190.avif 300w" /></figure></div>


<ol start="4" class="wp-block-list">
<li>The meeting editor will open. From here, you can:
<ul class="wp-block-list">
<li>Change the&nbsp;<strong>date</strong>&nbsp;and&nbsp;<strong>time</strong></li>



<li>Update the&nbsp;<strong>title</strong>&nbsp;or&nbsp;<strong>agenda</strong></li>



<li>Add or remove&nbsp;<strong>attendees</strong></li>



<li>Change the&nbsp;<strong>meeting duration</strong></li>



<li>Update any notes in the description field</li>
</ul>
</li>



<li>Once you&#8217;ve made your changes, click&nbsp;<strong>Send Update</strong>.</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f1eff0" data-has-transparency="false" style="--dominant-color: #f1eff0;" loading="lazy" decoding="async" width="1024" height="505" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/how-to-change-meeting-time-in-outlook-if-you-are-not-the-organizer-1024x505.avif" alt="how to change meeting time in outlook if you are not the organizer" class="wp-image-134027 not-transparent" title="how to change meeting time in outlook if you are not the organizer" srcset="https://www.spguides.com/wp-content/uploads/2026/04/how-to-change-meeting-time-in-outlook-if-you-are-not-the-organizer-1024x505.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/how-to-change-meeting-time-in-outlook-if-you-are-not-the-organizer-300x148.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/how-to-change-meeting-time-in-outlook-if-you-are-not-the-organizer-768x379.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/how-to-change-meeting-time-in-outlook-if-you-are-not-the-organizer.avif 1038w" /></figure></div>


<p>All attendees will receive an updated calendar invite with the new details.</p>



<blockquote class="wp-block-quote has-contrast-2-background-color has-background is-layout-flow wp-block-quote-is-layout-flow">
<p class="has-base-2-background-color has-background"><strong>Tip:</strong>&nbsp;Before you finalize the new time, use the&nbsp;<strong>Scheduling Assistant</strong>&nbsp;tab inside the meeting editor. It shows everyone&#8217;s free/busy status in a grid so you can pick a slot that works for the whole group.</p>
</blockquote>



<h3 class="wp-block-heading" id="method-3-reschedule-via-outlook-best-for-different">Method 3: Reschedule via Outlook (Best for Different Weeks)</h3>



<p>If you need to move a meeting to a completely different week, Teams&#8217; drag-and-drop doesn&#8217;t help much. The easiest workaround is to use <a href="https://www.spguides.com/power-automate-forward-meeting-invite-in-outlook/">Outlook </a>— either the desktop app or Outlook on the web.</p>



<ol class="wp-block-list">
<li>Open&nbsp;<strong>Outlook</strong>&nbsp;or go to&nbsp;<strong>outlook.office.com</strong>.</li>



<li>Click on&nbsp;<strong>Calendar</strong>&nbsp;in the left menu.</li>



<li>Find the meeting you want to move.</li>



<li><strong>Drag and drop it</strong>&nbsp;to the new date and time in the Outlook calendar view.</li>



<li>When prompted, choose whether to send an update to attendees.</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="e5eae4" data-has-transparency="false" style="--dominant-color: #e5eae4;" loading="lazy" decoding="async" width="1290" height="698" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/how-to-change-meeting-time-in-teams-if-you-are-not-the-organizer.gif" alt="how to change meeting time in teams if you are not the organizer" class="wp-image-134029 not-transparent" title="how to change meeting time in teams if you are not the organizer"></figure></div>


<p>Once you make the change in Outlook, it syncs back to Teams automatically. If Teams doesn&#8217;t refresh immediately, just click away from the calendar view and click back — it&#8217;ll update.</p>



<h2 class="wp-block-heading" id="how-to-reschedule-a-recurring-meeting-in-teams">Reschedule a Recurring Meeting in Teams</h2>



<p>Recurring meetings need a bit more thought. When you go to edit one, Teams will ask you a question: Do you want to change&nbsp;<strong>just this one occurrence</strong>&nbsp;or the&nbsp;<strong>entire series</strong>?</p>



<p>Here&#8217;s how to handle both scenarios.</p>



<h3 class="wp-block-heading" id="changing-just-one-occurrence">Changing Just One Occurrence</h3>



<p>Let&#8217;s say you have a weekly Monday standup and you need to skip one week because of a public holiday, but you want to hold it on Tuesday instead.</p>



<ol class="wp-block-list">
<li>Go to&nbsp;<strong>Calendar</strong>&nbsp;and find that specific Monday occurrence.</li>



<li>Click on it, then click&nbsp;<strong>Edit</strong>.</li>



<li>Teams will ask:&nbsp;<em>Edit this event or all future events?</em>&nbsp;Choose&nbsp;<strong>This event</strong>&nbsp;(or &#8220;Just this one&#8221;).</li>



<li>Change the date and time.</li>



<li>Click&nbsp;<strong>Send Update</strong>.</li>
</ol>



<p>Only that one instance gets rescheduled. Your regular weekly meeting stays untouched.</p>



<h3 class="wp-block-heading" id="changing-the-entire-series">Changing the Entire Series</h3>



<p>If the whole recurring schedule needs to shift — say you&#8217;re moving a bi-weekly meeting from Fridays to Thursdays going forward:</p>



<ol class="wp-block-list">
<li>Open any occurrence of the recurring meeting.</li>



<li>Click&nbsp;<strong>Edit</strong>.</li>



<li>When prompted, choose&nbsp;<strong>All events</strong>&nbsp;(or &#8220;This and all future events,&#8221; depending on your Teams version).</li>



<li>Make your changes to the date, time, or recurrence pattern.</li>



<li>Click&nbsp;<strong>Send Update</strong>.</li>
</ol>



<p>Everyone gets a fresh invite reflecting the updated schedule.</p>



<blockquote class="wp-block-quote has-contrast-2-background-color has-background is-layout-flow wp-block-quote-is-layout-flow">
<p class="has-base-2-background-color has-background"><strong>Important:</strong>&nbsp;Channel meetings (meetings tied to a Teams channel) have some restrictions on editing individual occurrences. If you run into trouble, the most reliable fix is to make the change through Outlook on the web instead.</p>
</blockquote>



<h2 class="wp-block-heading" id="how-to-cancel-a-teams-meeting">How to Cancel a Teams Meeting</h2>



<p>Canceling a Teams meeting is even simpler. Again, only the organizer can do this.</p>



<h3 class="wp-block-heading" id="method-1-cancel-from-the-teams-calendar">Method 1: Cancel from the Teams Calendar</h3>



<ol class="wp-block-list">
<li>Open&nbsp;<strong>Teams</strong>&nbsp;and click on&nbsp;<strong>Calendar</strong>.</li>



<li>Find the meeting you want to cancel.</li>



<li>Click on it to open the details panel.</li>



<li>Click&nbsp;<strong>Edit</strong>.</li>



<li>In the top menu, look for the&nbsp;<strong>Cancel Meeting</strong>&nbsp;button and click it.</li>



<li>A message box will appear — you can type a short note explaining why the meeting is cancelled. Something like&nbsp;<em>&#8220;This meeting has been cancelled. We&#8217;ll reschedule next week.&#8221;</em>&nbsp;goes a long way.</li>



<li>Click&nbsp;<strong>Send Cancellation</strong>.</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="f5f4f7" data-has-transparency="false" style="--dominant-color: #f5f4f7;" loading="lazy" decoding="async" width="678" height="466" sizes="(max-width: 678px) 100vw, 678px" src="https://www.spguides.com/wp-content/uploads/2026/04/cancel-teams-meeting.avif" alt="cancel teams meeting" class="wp-image-134031 not-transparent" title="cancel teams meeting" srcset="https://www.spguides.com/wp-content/uploads/2026/04/cancel-teams-meeting.avif 678w, https://www.spguides.com/wp-content/uploads/2026/04/cancel-teams-meeting-300x206.avif 300w" /></figure></div>


<p>All attendees receive a cancellation notice, and the meeting is automatically removed from their calendars.</p>



<h3 class="wp-block-heading" id="method-2-cancel-a-recurring-meeting">Method 2: Cancel a Recurring Meeting</h3>



<p>When you cancel a recurring meeting, Teams gives you two choices:</p>



<ul class="wp-block-list">
<li><strong>Cancel this occurrence</strong>&nbsp;— removes just this one meeting from everyone&#8217;s calendars</li>



<li><strong>Cancel the series</strong>&nbsp;— removes the entire recurring meeting for all future dates</li>
</ul>



<p>Here&#8217;s how:</p>



<ol class="wp-block-list">
<li>Open the recurring meeting from your&nbsp;<strong>Calendar</strong>.</li>



<li>Click&nbsp;<strong>Edit</strong>.</li>



<li>Click&nbsp;<strong>Cancel Meeting</strong>.</li>



<li>Choose whether you want to cancel&nbsp;<strong>just this occurrence</strong>&nbsp;or&nbsp;<strong>the entire series</strong>.</li>



<li>Add an optional message, then click&nbsp;<strong>Send Cancellation</strong>.</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-dominant-color="eff0f0" data-has-transparency="false" style="--dominant-color: #eff0f0;" loading="lazy" decoding="async" width="694" height="594" sizes="(max-width: 694px) 100vw, 694px" src="https://www.spguides.com/wp-content/uploads/2026/04/how-to-cancel-recurring-teams-meeting-in-outlook.avif" alt="how to cancel recurring teams meeting in outlook" class="wp-image-134032 not-transparent" title="how to cancel recurring teams meeting in outlook" srcset="https://www.spguides.com/wp-content/uploads/2026/04/how-to-cancel-recurring-teams-meeting-in-outlook.avif 694w, https://www.spguides.com/wp-content/uploads/2026/04/how-to-cancel-recurring-teams-meeting-in-outlook-300x257.avif 300w" /></figure></div>


<blockquote class="wp-block-quote has-contrast-2-background-color has-background is-layout-flow wp-block-quote-is-layout-flow">
<p class="has-base-2-background-color has-background"><strong>Example:</strong>&nbsp;You have a monthly team check-in, but December&#8217;s session isn&#8217;t needed because everyone&#8217;s on holiday. Cancel just that one occurrence, and your January meeting stays scheduled as normal.</p>
</blockquote>



<h2 class="wp-block-heading" id="what-if-you-see-a-delete-button-instead-of-cancel">What If You See a &#8220;Delete&#8221; Button Instead of &#8220;Cancel&#8221;?</h2>



<p>If you notice a&nbsp;<strong>Delete</strong>&nbsp;button instead of a&nbsp;<strong>Cancel Meeting</strong>&nbsp;button, it usually means no external attendees were invited — it might be a meeting you set up just for yourself, like a personal reminder or a quick internal block. Clicking Delete just removes it from your calendar without sending any notifications.</p>



<h2 class="wp-block-heading" id="cancelling-a-teams-meeting-on-mobile">Cancel a Teams Meeting on Mobile</h2>



<p>If you&#8217;re away from your desk, you can cancel or reschedule from the Teams mobile app too.</p>



<ol class="wp-block-list">
<li>Open the&nbsp;<strong>Teams app</strong>&nbsp;on your phone.</li>



<li>Tap the&nbsp;<strong>Calendar</strong>&nbsp;icon at the bottom.</li>



<li>Tap on the meeting you want to change.</li>



<li>Tap&nbsp;<strong>Edit</strong>&nbsp;or&nbsp;<strong>Cancel</strong>, depending on what you need.</li>



<li>If it&#8217;s recurring, choose whether to update just this occurrence or the whole series.</li>



<li>Add a message for your attendees.</li>



<li>Tap&nbsp;<strong>Send</strong>.</li>
</ol>



<p>It works exactly like the desktop version — just on a smaller screen.</p>



<h2 class="wp-block-heading" id="a-few-things-to-keep-in-mind">A Few Things to Keep in Mind</h2>



<ul class="wp-block-list">
<li><strong>You must be the organizer</strong>&nbsp;to reschedule or cancel. If you&#8217;re an attendee, you can only decline — not cancel.</li>



<li><strong>Always add a message</strong>&nbsp;when cancelling. Even one sentence helps attendees understand what&#8217;s happening and whether to expect a rescheduled meeting.</li>



<li><strong>Check the Scheduling Assistant</strong>&nbsp;before confirming a new time. It saves the back-and-forth of finding a slot that works for everyone.</li>



<li><strong>Recurring channel meetings</strong>&nbsp;can be tricky to edit from Teams directly. When in doubt, use Outlook on the web — it&#8217;s more reliable for those cases.</li>



<li>If someone&nbsp;<strong>wasn&#8217;t invited</strong>&nbsp;to the meeting originally and you need to add them before rescheduling, open the meeting editor, add their name in the attendees field, then send the update. They&#8217;ll get the full invite.</li>
</ul>



<h2 class="wp-block-heading" id="wrapping-up">Conclusion</h2>



<p>I hope you found this article helpful. In this guide, I explained how to reschedule or cancel a meeting in Microsoft Teams. I also showed different methods, such as drag-and-drop, edit options, and Outlook. These steps are simple and easy to follow.</p>



<p>If you need to reschedule a meeting, choose the method that best suits your situation. Be careful when updating recurring meetings. Also, inform your attendees clearly about any changes. This will help avoid confusion and keep everyone updated.</p>



<p>Also, you may like:</p>



<ul class="wp-block-list">
<li><a href="https://www.spguides.com/start-an-instant-message-in-microsoft-teams/">6 Various Ways to Start an Instant Message in Microsoft Teams</a></li>



<li><a href="https://www.spguides.com/microsoft-teams-auto-mute-on-join/">Microsoft Teams Auto Mute When Joining a Meeting</a></li>



<li><a href="https://www.spguides.com/whiteboard-in-microsoft-teams/">Whiteboard in Microsoft Teams On Laptop</a></li>



<li><a href="https://www.spguides.com/create-announcement-in-microsoft-teams/">Create an Announcement in Microsoft Teams</a></li>



<li><a href="https://www.spguides.com/send-a-microsoft-teams-invite/">Send a Microsoft Teams Invite [5 Best Methods]</a></li>



<li><a href="https://www.spguides.com/change-password-in-microsoft-teams/">4 Tricky Ways to Change Password in Microsoft Teams</a></li>
</ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>5 Best Methods to Set Microsoft Teams as Default Meeting in Outlook</title>
		<link>https://www.spguides.com/set-microsoft-teams-as-default-meeting-in-outlook/</link>
		
		<dc:creator><![CDATA[Bijay Kumar]]></dc:creator>
		<pubDate>Fri, 24 Apr 2026 11:00:00 +0000</pubDate>
				<category><![CDATA[Microsoft Teams]]></category>
		<category><![CDATA[Set Microsoft Teams as Default Meeting in Outlook]]></category>
		<guid isPermaLink="false">https://www.spguides.com/?p=131705</guid>

					<description><![CDATA[If you use Microsoft Teams for all your online meetings, you already know the frustration of creating a new calendar event in Outlook and then having to manually add the Teams link every single time. It gets old fast. The good news? You can set Microsoft Teams as your default meeting provider in Outlook so ... <a title="5 Best Methods to Set Microsoft Teams as Default Meeting in Outlook" class="read-more" href="https://www.spguides.com/set-microsoft-teams-as-default-meeting-in-outlook/" aria-label="Read more about 5 Best Methods to Set Microsoft Teams as Default Meeting in Outlook">read more...</a>]]></description>
										<content:encoded><![CDATA[
<p>If you use <a href="https://www.spguides.com/microsoft-teams/">Microsoft Teams</a> for all your online meetings, you already know the frustration of creating a new calendar event in Outlook and then having to manually add the Teams link every single time. It gets old fast.</p>



<p>The good news? You can set Microsoft Teams as your default meeting provider in Outlook so that every new meeting you create automatically comes with a Teams link — no extra clicks needed.</p>



<p>In this tutorial, I&#8217;ll walk you through how to do this across different versions of Outlook: Classic Outlook (desktop), New Outlook, Outlook on the Web, and Outlook for Mac.</p>



<h2 class="wp-block-heading" id="why-set-teams-as-default">Why Set Teams as Default?</h2>



<p>Before jumping into the steps, let me quickly explain why this matters beyond saving a click or two:</p>



<ul class="wp-block-list">
<li><strong>Consistency</strong>&nbsp;— Everyone on your team gets a Teams link without you having to think about it.</li>



<li><strong>Less manual work</strong>&nbsp;— No more forgetting to attach the meeting link before hitting Send.</li>



<li><strong>Better attendee experience</strong>&nbsp;— Your invites always look complete and professional.</li>



<li><strong>Works across time zones</strong>&nbsp;— Whether you&#8217;re <a href="https://www.spguides.com/record-screen-in-microsoft-teams-without-a-meeting/">inviting</a> someone internal or external, the link is always there.</li>
</ul>



<p>If your organization is fully remote or hybrid and uses Teams as its primary communication tool, making it the default just makes sense.</p>



<h2 class="wp-block-heading" id="before-you-start--check-these-two-things">Before You Start: Check These Two Things</h2>



<p>No matter which method you use, make sure:</p>



<ol class="wp-block-list">
<li><strong>Microsoft Teams is installed on your computer.</strong>&nbsp;The Teams add-in for <a href="https://outlook.office.com/" target="_blank" rel="noopener">Outlook</a> only shows up if Teams is already installed and active.</li>



<li><strong>You&#8217;re signed in to both Outlook and Teams with the same Microsoft 365 work or school account.</strong>&nbsp;If the accounts don&#8217;t match, Teams won&#8217;t appear as a meeting provider option.</li>
</ol>



<p>If Teams is missing from Outlook entirely, I&#8217;ll cover that fix at the end of this tutorial.</p>



<h2 class="wp-block-heading">Set Microsoft Teams as the Default Meeting in Outlook</h2>



<p>Now I will show you how to set Microsoft Teams as the default meeting in Outlook.</p>



<h3 class="wp-block-heading" id="method-1-classic-outlook-for-windows-outlook-2016">Method 1: Classic Outlook for Windows (Outlook 2016, 2019, 2021, and Microsoft 365)</h3>



<p>This is the most common version that most people are using at work. Here&#8217;s how to set Teams as the default:</p>



<ol class="wp-block-list">
<li>Open&nbsp;<strong>Microsoft Outlook</strong>.</li>



<li>Click&nbsp;<strong>File</strong>&nbsp;in the top-left corner.</li>



<li>Click&nbsp;<strong>Options</strong>&nbsp;in the left sidebar. This opens the Outlook Options dialog.</li>



<li>In the left panel of the dialog, click&nbsp;<a href="https://www.spguides.com/add-calendar-list-in-the-modern-sharepoint-online-site-page/">Calendar</a>.</li>



<li>Scroll down to the&nbsp;<strong>Calendar options</strong>&nbsp;section.</li>



<li>Check the box that says&nbsp;<strong>&#8220;Add online meeting to all meetings&#8221;</strong>.</li>



<li>Click the&nbsp;<strong>Meeting Providers…</strong>&nbsp;button (you&#8217;ll see this right below or next to that checkbox).</li>



<li>In the&nbsp;<strong>Online Meeting</strong>&nbsp;dialog that opens:
<ul class="wp-block-list">
<li>Make sure the&nbsp;<strong>&#8220;Add online meeting&#8221;</strong>&nbsp;checkbox is ticked.</li>



<li>Under the list of providers, select&nbsp;<strong>Microsoft Teams</strong>.</li>
</ul>
</li>



<li>Click&nbsp;<strong>OK</strong>, then&nbsp;<strong>OK</strong>&nbsp;again to close out.</li>
</ol>



<p>That&#8217;s it. From now on, every new meeting you create in Outlook will automatically include a Microsoft Teams link. You don&#8217;t need to touch anything else when creating the invite.</p>



<p><strong>Quick tip:</strong>&nbsp;If you see multiple accounts in the dropdown inside that Online Meeting dialog, make sure you pick the right one. If you use a personal account alongside your work account, Teams will only work as the default for your work (Microsoft 365) account.</p>



<h3 class="wp-block-heading" id="method-2-new-outlook-for-windows">Method 2: New Outlook for Windows</h3>



<p>Microsoft has been rolling out the New Outlook as the updated version for Windows users. The interface looks different, and so do the steps.</p>



<ol class="wp-block-list">
<li>Open the&nbsp;<strong>New Outlook</strong>&nbsp;app.</li>



<li>Click the&nbsp;<strong>Settings gear icon</strong>&nbsp;in the upper-right corner.</li>



<li>In the Settings panel, go to&nbsp;<strong>Calendar</strong>.</li>



<li>Click on&nbsp;<strong>Events and invitations</strong>.</li>



<li>Under the&nbsp;<strong>Events you create</strong>&nbsp;section, toggle on&nbsp;<strong>&#8220;Add online meeting to all meetings&#8221;</strong>.</li>



<li>In the&nbsp;<strong>&#8220;Choose a meeting provider&#8221;</strong>&nbsp;dropdown, select&nbsp;<strong>Microsoft Teams</strong>.</li>



<li>Click&nbsp;<strong>Save</strong>.</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="dee7f0" data-has-transparency="false" style="--dominant-color: #dee7f0;" loading="lazy" decoding="async" width="1024" height="260" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/How-to-Set-Microsoft-Teams-as-Default-Meeting-in-Outlook-1024x260.avif" alt="How to Set Microsoft Teams as Default Meeting in Outlook" class="wp-image-134085 not-transparent" title="How to Set Microsoft Teams as Default Meeting in Outlook" srcset="https://www.spguides.com/wp-content/uploads/2026/04/How-to-Set-Microsoft-Teams-as-Default-Meeting-in-Outlook-1024x260.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/How-to-Set-Microsoft-Teams-as-Default-Meeting-in-Outlook-300x76.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/How-to-Set-Microsoft-Teams-as-Default-Meeting-in-Outlook-768x195.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/How-to-Set-Microsoft-Teams-as-Default-Meeting-in-Outlook-1536x390.avif 1536w, https://www.spguides.com/wp-content/uploads/2026/04/How-to-Set-Microsoft-Teams-as-Default-Meeting-in-Outlook.avif 1885w" /></figure></div>


<p>Done. The new Outlook saves this at the account level, so if you have more than one account set up, look for the&nbsp;<strong>&#8220;These settings are applied at the account level&#8221;</strong>&nbsp;dropdown near the top of that section and make sure you&#8217;ve selected the right account before saving.</p>



<h3 class="wp-block-heading" id="method-3-outlook-on-the-web-owa">Method 3: Outlook on the Web (OWA)</h3>



<p>If you use Outlook through your browser (the web version), the steps are almost identical to New Outlook.</p>



<ol class="wp-block-list">
<li>Go to&nbsp;<a href="https://outlook.office.com/" target="_blank" rel="noreferrer noopener">outlook.office.com</a>&nbsp;and sign in.</li>



<li>Click the&nbsp;<strong>gear icon (Settings)</strong>&nbsp;in the upper-right corner.</li>



<li>Select&nbsp;<strong>Calendar</strong>&nbsp;from the left menu.</li>



<li>Click&nbsp;<strong>Events and invitations</strong>.</li>



<li>Check the&nbsp;<strong>&#8220;Add online meeting to all meetings&#8221;</strong>&nbsp;box.</li>



<li>Under&nbsp;<strong>&#8220;Choose a meeting provider&#8221;</strong>, pick&nbsp;<strong>Microsoft Teams</strong>.</li>



<li>Hit&nbsp;<strong>Save</strong>.</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="f5f5f6" data-has-transparency="false" style="--dominant-color: #f5f5f6;" loading="lazy" decoding="async" width="1024" height="296" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/Set-Microsoft-Teams-as-the-Default-Meeting-in-Outlook-1024x296.avif" alt="Set Microsoft Teams as the Default Meeting in Outlook" class="wp-image-134086 not-transparent" title="Set Microsoft Teams as the Default Meeting in Outlook" srcset="https://www.spguides.com/wp-content/uploads/2026/04/Set-Microsoft-Teams-as-the-Default-Meeting-in-Outlook-1024x296.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/Set-Microsoft-Teams-as-the-Default-Meeting-in-Outlook-300x87.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/Set-Microsoft-Teams-as-the-Default-Meeting-in-Outlook-768x222.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/Set-Microsoft-Teams-as-the-Default-Meeting-in-Outlook-1536x444.avif 1536w, https://www.spguides.com/wp-content/uploads/2026/04/Set-Microsoft-Teams-as-the-Default-Meeting-in-Outlook.avif 1602w" /></figure></div>


<p>This change only affects <a href="https://www.spguides.com/you-dont-have-permission-to-create-private-meetings/">meetings</a> you create through the web browser. If you also use the desktop app, you&#8217;ll need to set it there separately.</p>



<h3 class="wp-block-heading" id="method-4-outlook-for-mac">Method 4: Outlook for Mac</h3>



<p>If you&#8217;re on a Mac, the process is slightly different but still straightforward.</p>



<ol class="wp-block-list">
<li>Open&nbsp;<strong>Microsoft Outlook</strong>&nbsp;on your Mac.</li>



<li>Click&nbsp;<strong>Outlook</strong>&nbsp;in the top menu bar (next to the Apple icon).</li>



<li>Select&nbsp;<strong>Preferences</strong>.</li>



<li>Click&nbsp;<strong>Calendar</strong>.</li>



<li>Look for&nbsp;<strong>&#8220;Add online meeting to all meetings&#8221;</strong>&nbsp;and check that box.</li>



<li>Click&nbsp;<strong>Configure Providers</strong>&nbsp;next to it.</li>



<li>In the provider list, select&nbsp;<strong>Microsoft Teams</strong>&nbsp;as your default.</li>



<li>Close the preferences window.</li>
</ol>



<p>Your Mac will now automatically add a Teams meeting link to every new event you schedule from Outlook.</p>



<h3 class="wp-block-heading" id="method-5-admin-level-default-setting-for-it-admins">Method 5: Admin-Level Default Setting (For IT Admins)</h3>



<p>If you&#8217;re an IT admin and you want to set Microsoft Teams as the default meeting provider for everyone in your organization — not just yourself — you can do it from the Microsoft 365 admin center or using PowerShell.</p>



<p><strong>From the Teams Admin Center:</strong></p>



<ol class="wp-block-list">
<li>Go to&nbsp;<a href="https://admin.teams.microsoft.com/" target="_blank" rel="noreferrer noopener">admin.teams.microsoft.com</a>.</li>



<li>In the left menu, click&nbsp;<strong>Meetings</strong>&nbsp;&gt;&nbsp;<strong>Meeting policies</strong>.</li>



<li>Click on the policy that applies to your users (usually &#8220;Global (Org-wide default)&#8221;).</li>



<li>Review and configure the online meeting settings as needed.</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-dominant-color="e5e5f4" data-has-transparency="false" style="--dominant-color: #e5e5f4;" loading="lazy" decoding="async" width="1024" height="400" sizes="(max-width: 1024px) 100vw, 1024px" src="https://www.spguides.com/wp-content/uploads/2026/04/set-Microsoft-Teams-as-Default-Meeting-in-Admin-Level-1024x400.avif" alt="set Microsoft Teams as Default Meeting in Admin-Level" class="wp-image-134087 not-transparent" title="set Microsoft Teams as Default Meeting in Admin Level" srcset="https://www.spguides.com/wp-content/uploads/2026/04/set-Microsoft-Teams-as-Default-Meeting-in-Admin-Level-1024x400.avif 1024w, https://www.spguides.com/wp-content/uploads/2026/04/set-Microsoft-Teams-as-Default-Meeting-in-Admin-Level-300x117.avif 300w, https://www.spguides.com/wp-content/uploads/2026/04/set-Microsoft-Teams-as-Default-Meeting-in-Admin-Level-768x300.avif 768w, https://www.spguides.com/wp-content/uploads/2026/04/set-Microsoft-Teams-as-Default-Meeting-in-Admin-Level-1536x600.avif 1536w, https://www.spguides.com/wp-content/uploads/2026/04/set-Microsoft-Teams-as-Default-Meeting-in-Admin-Level.avif 1919w" /></figure></div>


<p><strong>Using PowerShell (Exchange Online):</strong></p>



<p>If you want to set the default meeting provider using <a href="https://www.spguides.com/powershell-tutorials/">PowerShell</a>, you can use this command:</p>



<pre class="wp-block-preformatted"><code>Set-MailboxCalendarConfiguration -Identity user@yourdomain.com -DefaultOnlineMeetingProvider TeamsForBusiness</code></pre>



<p>Replace&nbsp;<code>user@yourdomain.com</code>&nbsp;with the actual user&#8217;s email. The value&nbsp;<code>TeamsForBusiness</code>&nbsp;is the official parameter value for Microsoft Teams in this cmdlet.</p>



<p>To apply it to all users in bulk:</p>



<pre class="wp-block-preformatted"><code>Get-Mailbox -ResultSize Unlimited | Set-MailboxCalendarConfiguration -DefaultOnlineMeetingProvider TeamsForBusiness</code></pre>



<p>This is the most efficient way if you&#8217;re managing a large organization and don&#8217;t want each user to change it manually.</p>



<h2 class="wp-block-heading" id="switching-default-from-zoom-or-webex-to-teams">Switching Default from Zoom or Webex to Teams</h2>



<p>If your organization previously used Zoom or Webex and you want to switch the default over to Teams, just follow Method 1 (or the method for your version of Outlook) and in the provider list, deselect Zoom or Webex and select Microsoft Teams instead. Outlook will follow your new preference going forward. Old meetings already created won&#8217;t be affected — only new ones.</p>



<h2 class="wp-block-heading" id="turning-it-off--how-to-stop-outlook-from-auto-addi">Turning It Off — How to Stop Outlook from Auto-Adding Teams</h2>



<p>If for any reason you want to stop Outlook from automatically adding Teams links to every meeting (maybe some meetings are in-person), here&#8217;s how to turn it off:</p>



<p><strong>Classic Outlook:</strong></p>



<ul class="wp-block-list">
<li>Go to&nbsp;<strong>File</strong>&nbsp;&gt;&nbsp;<strong>Options</strong>&nbsp;&gt;&nbsp;<strong>Calendar</strong>.</li>



<li>Click&nbsp;<strong>Meeting Providers…</strong></li>



<li>Uncheck&nbsp;<strong>&#8220;Add online meeting to all meetings&#8221;</strong>.</li>



<li>Click OK twice.</li>
</ul>



<p><strong>New Outlook / Web:</strong></p>



<ul class="wp-block-list">
<li>Go to&nbsp;<strong>Settings</strong>&nbsp;&gt;&nbsp;<strong>Calendar</strong>&nbsp;&gt;&nbsp;<strong>Events and invitations</strong>.</li>



<li>Toggle off&nbsp;<strong>&#8220;Add online meeting to all meetings&#8221;</strong>.</li>



<li>Save.</li>
</ul>



<h2 class="wp-block-heading" id="final-thoughts">Final Thoughts</h2>



<p>Setting Microsoft Teams as your default meeting provider in Outlook is one of those small changes that saves you a surprising amount of time over a week. Once it&#8217;s set up, you stop thinking about it — and that&#8217;s exactly how it should be.</p>



<p>The steps vary slightly depending on which version of Outlook you&#8217;re using, but the core idea is the same: open the online meeting settings, check the box to add the meeting to all events, and select Microsoft Teams as your provider.</p>



<p>You may also like:</p>



<ul class="wp-block-list">
<li><a href="https://www.spguides.com/enable-gifs-in-microsoft-teams/">Enable GIFs in Microsoft Teams</a></li>



<li><a href="https://www.spguides.com/reschedule-teams-meeting-in-microsoft-teams/">Reschedule or Cancel a Teams Meeting in Microsoft Teams</a></li>



<li><a href="https://www.spguides.com/print-microsoft-teams-chat/">Print Microsoft Teams Chat</a></li>



<li><a href="https://www.spguides.com/zoom-in-on-microsoft-teams/">How to Zoom In on Microsoft Teams</a></li>



<li><a href="https://www.spguides.com/disable-notifications-during-a-meeting-in-microsoft-teams/">Disable Notifications During a Meeting in Microsoft Teams</a></li>
</ul>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
