cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DesmondDekker
Frequent Visitor

Send an email with OneNote pages that have been recently modified

Hi

I'm looking for an experienced Power Automate user who would be able to help me with creating a more advanced version of this template:

 

DesmondDekker_1-1616168080489.png

 

So this template works fine, but there is one problem - it sends a modified page in this way:

 

DesmondDekker_2-1616168105002.png

 

I would like to create a flow which could detect if the same page was modified a few times and send an email only with one unique name of a page and one link to it - so the "Ideas - Test 4" wouldn't be repeated 4 times. Now, as I understand, the flow is taking into account all changes made in the page.

 

I'm also sending screenshots of the whole flow:

 

DesmondDekker_3-1616168136406.png

 

DesmondDekker_4-1616168147824.png

 

DesmondDekker_5-1616168154084.png

 

DesmondDekker_6-1616168160122.png

DesmondDekker_7-1616168203864.png


Really appreciate any help!

 

1 ACCEPTED SOLUTION

Accepted Solutions
robofski
Helper II
Helper II

In the Iterate current OneNote section you need to modify the compose action in the Yes branch of the condition to add a delimiter to the end of the string, in my case I used a ~ it needs to be something that won't appear in your page names.

robofski_0-1616760334385.png

 

Then before you send the email you want to add two compose actions, the first will split the list of pages into an Array based on the delimiter we used earlier and the second will take the output from that action and merge to leave only unique records:

robofski_0-1616767653024.png

 

For clarity, the expression used for the split was:

split(substring(variables('ListOfPages'),0,sub(length(variables('ListOfPages')),1)),'~')

 

and for the union:

union(outputs('Compose_2'),outputs('Compose_2'))

 

After this we need to clear out the ListofPages Variable by using a set variable action and just entering a space (it insists on entering something for the value

robofski_1-1616767789301.png

 

Finally we want to populate the ListofPages variable with the results from the Union so we can use an apply to each loop to loop through the output of the union and just append that as text to the variable.

robofski_2-1616767958256.png

 

Hopefully you can follow but if you need any clarity, please let me know. 

 

 

 

 

View solution in original post

2 REPLIES 2
robofski
Helper II
Helper II

In the Iterate current OneNote section you need to modify the compose action in the Yes branch of the condition to add a delimiter to the end of the string, in my case I used a ~ it needs to be something that won't appear in your page names.

robofski_0-1616760334385.png

 

Then before you send the email you want to add two compose actions, the first will split the list of pages into an Array based on the delimiter we used earlier and the second will take the output from that action and merge to leave only unique records:

robofski_0-1616767653024.png

 

For clarity, the expression used for the split was:

split(substring(variables('ListOfPages'),0,sub(length(variables('ListOfPages')),1)),'~')

 

and for the union:

union(outputs('Compose_2'),outputs('Compose_2'))

 

After this we need to clear out the ListofPages Variable by using a set variable action and just entering a space (it insists on entering something for the value

robofski_1-1616767789301.png

 

Finally we want to populate the ListofPages variable with the results from the Union so we can use an apply to each loop to loop through the output of the union and just append that as text to the variable.

robofski_2-1616767958256.png

 

Hopefully you can follow but if you need any clarity, please let me know. 

 

 

 

 

Everything is working! Thank you very much and have a nice weekend 😃

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (4,954)