web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Can't use Ampersand (&...
Power Automate
Unanswered

Can't use Ampersand (&) in OneNote action: "Get sections in a notebook"

(0) ShareShare
ReportReport
Posted on by 7

I have 500 notebooks that need to have a page that contains the name of the notebook as the page title. It appears that the notebook key input of the "Get sections in notebook" action fails if the title of the notebook contains an ampersand. This failure occurs even if I request the notebook from the dropdown for "Notebook key" in the action.  

 

For reference, the notebook key input is formatted as: "<Notebook Name>|$|<Full site address of the notebook on SharePoint>"

 

Is there a workaround to escape the ampersand in the notebook name, or do I have to rename all notebooks that have an ampersand in the notebook name?

Categories:
I have the same question (0)
  • David_MA Profile Picture
    12,966 Super User 2025 Season 2 on at

    How were you able to create a section in your notebook containing an ampersand? If I try to create a section with an ampersand, I get this error message:

    David_MA_0-1669052260512.png

     

  • devins Profile Picture
    7 on at

    The notebook name has an ampersand, not the section. But the "get section" action requires a notebook ID. The request to get that ID is formatted as <Notebook Name>|$|<Full site address of the notebook on SharePoint>. The <Notebook Name> part of that request is where it is failing if it has an ampersand. 

  • devins Profile Picture
    7 on at

    Update: I decided to work around this issue by renaming all notebooks from '&' to 'and' using PowerRename desktop tool from Microsoft's PowerToys application. In Windows Explorer, I can rename all notebooks in all subfolders using the regex "&" and replacing with "and". I will run the automation and then rename the notebooks back to "&" using the same method. 

     

    Note: this method assumes you are syncing the sharepoint document library to your local machine.

  • David_MA Profile Picture
    12,966 Super User 2025 Season 2 on at

    I guess you'd better show your flow. I just created a notebook with an ampersand and ran my flow and had no errors. When the notebook was created, the ampersand was replaced with an underscore. 

    David_MA_0-1669053803026.png

    Maybe the auto-renaming is a recent behavior that MS introduced. I know they recently did this for files uploaded to OneDrive. OneDrive can rename files with invalid characters - Microsoft Support.

  • devins Profile Picture
    7 on at

    Interesting. I created the notebooks by copying a template to each folder using power automate's sharepoint 'copy to' action, then renamed the notebook .url links in windows explorer using a keyboard macro to copy the parent folder name and paste it in as the notebook name. I can also rename the notebooks in sharepoint using an ampersand. When I tried to list a notebook using the "recent notebooks" dropdown in the "get sections from notebook" action, the raw input contained an ampersand as the name and key.

    I can't verify if the notebooks have another name attribute that changes the ampersand to an underscore like your example because I already renamed the notebooks to use an "and" (see my reply to my post). I will test after my page title naming flow is finished and I have renamed the notebooks back to using an ampersand (not my decision to use this naming scheme, btw). 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard