Confluence automation for Iterative/loop
Asked by venkata naram:

Could you set a rule to run only on pages not modified in the last 'n' number of days? Build a rule to list the number of pages and send just one email notification to all the pages.

I have a Confluence automation rule for a page branch where the last modified date is less than a specified number of days.

In the email notification handling the loop, I have given the below code

{{#Page}} {{title}} ((/Page}}


Answers:
author: Manon Soubies-Camy
body: Hi [@venkata naram](/t5/user/viewprofilepage/user-id/5574537) and welcome to Community!

You can add a page branch to perform actions on pages updated more than x days ago, for example:

![Capture d?e?cran 2024-09-10 a? 11.07.59.png](https://community.atlassian.com/t5/image/serverpage/image-id/346507i4E7992BACB392369/image-size/large?v=v2&px=999 "Capture d?e?cran 2024-09-10 a? 11.07.59.png")

Hope this helps!

- Manon

comments: author: venkata naram
body: Hi [@Manon Soubies-Camy](/t5/user/viewprofilepage/user-id/1215212)

Thank you for your immediate response. I seek an iterative process to avoid sending multiple emails for each page. I will try to rephrase my question.

I have created a page branch that returns multiple pages when they satisfy the condition of being updated more than 15 days ago. Currently, I have an action that sends an email notification for each page, resulting in multiple emails.

For example, if the page branch returns four wiki pages, it will send four separate emails. I want to send only one email that consolidates all the pages into the email content. How can I achieve this using an iterative process or loop in the email content?

If you refer to the template that notifies people about inactive pages, I want to achieve the same result using that method.

Thanks

Venkata


author: Manon Soubies-Camy
body: Hi [@venkata naram](/t5/user/viewprofilepage/user-id/5574537), ah, ok, I get it now, thanks for the additional context!

The Lookup action searches for pages meeting your condition:

![lookup.png](https://community.atlassian.com/t5/image/serverpage/image-id/346755i61D4B8278DFAFDB7/image-size/large?v=v2&px=999 "lookup.png")

And you can then use the result in other actions, such as:

![lookup-email.png](https://community.atlassian.com/t5/image/serverpage/image-id/346756i73DA7BA6A1D33F31/image-size/large?v=v2&px=999 "lookup-email.png")

Is that what you are trying to achieve?


author: venkata naram
body: The given solution with lookupPages is not working. Below is the error I'm facing:

![Screenshot 2024-09-12 172810.png](https://community.atlassian.com/t5/image/serverpage/image-id/347229i3B5F87FBDC5C9CFB/image-size/large?v=v2&px=999 "Screenshot 2024-09-12 172810.png")


author: Manon Soubies-Camy
body: Can you please share a screenshot of your rule as well?


author: venkata naram
body: Sorry for the delayed response. Below is the screenshot.

![Screenshot 2024-09-16 085500.png](https://community.atlassian.com/t5/image/serverpage/image-id/347535i3F28B7903957A7FA/image-size/large?v=v2&px=999 "Screenshot 2024-09-16 085500.png")![Screenshot 2024-09-16 085603.png](https://community.atlassian.com/t5/image/serverpage/image-id/347536iC22D837EA94FCBDB/image-size/large?v=v2&px=999 "Screenshot 2024-09-16 085603.png")


author: venkata naram
body: Hi [@Manon Soubies-Camy](/t5/user/viewprofilepage/user-id/1215212) , Any update.


author: Manon Soubies-Camy
body: Hi [@venkata naram](/t5/user/viewprofilepage/user-id/5574537), I cannot reproduce your issue. I seem to run into the same bug than this [Community post](https://community.atlassian.com/t5/Confluence-questions/Smart-Values-in-Lookup-Pages-not-working/qaq-p/2651192) though, as the email I receive is blank, so I'd recommend reaching out to [Confluence's support team](https://support.atlassian.com/contact).