cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous5
Helper III
Helper III

Utilizing OneNote Data Tag Attributes

Hello, 

 

I am currently using the OneNote connection with Power Automate to create a weekly "oneliner" update form based on a OneNote template. This is working well but there is one further aspect I'd like to explore. 

 

The OneNote document is set up with a series of bullets to categorize team updates for the week. At the bottom of the page, there is a section titled "Input Check Off" with a list of team member names and To-Do checkbox tags. See the screenshot below:

 

OneNote Screenshot.PNG

This is intended to indicate that all team members have gotten a look at the document and have made their entries. What I would like to do is run a Flow to check this document at the end of the work day on the weekly due date and notify team members who may have forgotten to check in. Using the "Get page content" action in Power Automate I am able to "see" these results in HTML format like so:

 

OneNote Screenshot2.PNG

At the bottom portion of this output you can see clearly that each Persons data tag attribute shows the current status to-do or to-do:completed. I realize this is not natively supported as a OneNote action but is there any way I can do the following:

 

  • Extract the Input Check-Off list portion from the page content
  • Format this information in such a way that it usable in Power Automate
  • Correlate each person to their status on the document (completed/not completed) (Perhaps an Apply to Each)
  • Recognize each person as an employee at our organization
  • Use a condition to send a notification to those people in the form of a reminder (outlook message, Teams message, etc.) that they need to make their updates?

I realize this may be a tall order. I appreciate any help that can be give here.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi  @Anonymous5 ,

 

Please try to use xpath() function.

Sample:

vxiaochenmsft_0-1655704204600.png

vxiaochenmsft_6-1655704463551.png

vxiaochenmsft_7-1655704486174.png

vxiaochenmsft_8-1655704494648.png

vxiaochenmsft_9-1655704501877.png

@{range(1,length(xpath(xml(split(split(outputs('Get_page_content')?['body'],'</head>')[1],'</html>')[0]),'//p[@data-tag="to-do"]')))}

 

string(//p[@data-tag="to-do"][@{items('Apply_to_each')}])

 

@{xpath(xml(split(split(outputs('Get_page_content')?['body'],'</head>')[1],'</html>')[0]),outputs('Compose_2'))};

 

My page content:

<html lang="en-US">
	<head>
		<title>Test</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="created" content="2022-06-20T10:50:00.0000000" />
	</head>
	<body data-absolute-enabled="true" style="font-family:Calibri;font-size:11pt">
		<div style="position:absolute;left:48px;top:115px;width:624px">
			<p data-tag="to-do:completed" style="margin-top:0pt;margin-bottom:0pt">AA</p>
			<p data-tag="to-do" style="margin-top:0pt;margin-bottom:0pt">BB</p>
			<p data-tag="to-do" style="margin-top:0pt;margin-bottom:0pt">CC</p>
			<br />
			<br />
			<br />
		</div>
	</body>
</html>

 

Result:

vxiaochenmsft_10-1655704578285.png

 

Best Regards,

Wearsky

View solution in original post

2 REPLIES 2
v-xiaochen-msft
Community Support
Community Support

Hi  @Anonymous5 ,

 

Please try to use xpath() function.

Sample:

vxiaochenmsft_0-1655704204600.png

vxiaochenmsft_6-1655704463551.png

vxiaochenmsft_7-1655704486174.png

vxiaochenmsft_8-1655704494648.png

vxiaochenmsft_9-1655704501877.png

@{range(1,length(xpath(xml(split(split(outputs('Get_page_content')?['body'],'</head>')[1],'</html>')[0]),'//p[@data-tag="to-do"]')))}

 

string(//p[@data-tag="to-do"][@{items('Apply_to_each')}])

 

@{xpath(xml(split(split(outputs('Get_page_content')?['body'],'</head>')[1],'</html>')[0]),outputs('Compose_2'))};

 

My page content:

<html lang="en-US">
	<head>
		<title>Test</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="created" content="2022-06-20T10:50:00.0000000" />
	</head>
	<body data-absolute-enabled="true" style="font-family:Calibri;font-size:11pt">
		<div style="position:absolute;left:48px;top:115px;width:624px">
			<p data-tag="to-do:completed" style="margin-top:0pt;margin-bottom:0pt">AA</p>
			<p data-tag="to-do" style="margin-top:0pt;margin-bottom:0pt">BB</p>
			<p data-tag="to-do" style="margin-top:0pt;margin-bottom:0pt">CC</p>
			<br />
			<br />
			<br />
		</div>
	</body>
</html>

 

Result:

vxiaochenmsft_10-1655704578285.png

 

Best Regards,

Wearsky

Hello Wearsky,

 

I just want to say thanks as this was just what I needed. I made a slight edit by adding an "Apply to Each" control to the results to be able to send out notification emails to the individual people involved.

 

Rgds,

Rob

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,185)