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

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Adding multiple SP lis...
Power Automate
Unanswered

Adding multiple SP list items to HTML with conditions

(0) ShareShare
ReportReport
Posted on by

Hey All, 

 

I have a flow thats working but I want to put all the items that meet the condition into a table rather than multiple emails. 

 

Heres the flow..Now the slight oddness here is that the flow errors but still send the emails at the moment. but not sure if the error is stopping the table from working.

gardnerlhwrc_0-1646992921880.png

Left

formatDateTime(item()['PermiteEndDate'],'dd-MM-yyyy')

Right

addDays(utcNow(),1,'dd-MM-yyyy')

 

Tried adding Select > Create HTML table after 'Get Items' and after the condition but no joy on either. 

 

Thanks  L

Categories:
I have the same question (0)
  • fchopo Profile Picture
    8,003 Moderator on at
    Re: Adding multiple SP list items to HTML with conditions

    Hi @Anonymous 

    You can use the condition in the filter query expression on the get items action:

    devices-flow.png

     

    After that, you can create the HTML table and send it by email.

    Hope it helps!

    Ferran

  • Community Power Platform Member Profile Picture
    on at
    Re: Adding multiple SP list items to HTML with conditions

    Oh great, so the expression in the filter would look something like this? Please excuse the spoon feeding here. i'm rather new to this. 

    formatDateTime(item()['PermiteEndDate'],'dd-MM-yyyy') eq addDays(utcNow(),1,'dd-MM-yyyy')
     
    Thanks L
     
  • fchopo Profile Picture
    8,003 Moderator on at
    Re: Adding multiple SP list items to HTML with conditions

    Exactly, using the "expression" for both condiitons.

    Have a look here: Solved: Get Items Filter Query - Power Platform Community (microsoft.com)

    Ferran

  • Community Power Platform Member Profile Picture
    on at
    Re: Adding multiple SP list items to HTML with conditions

    So hitting the similar error as I was before which looks like its stopping the get items. 

     

    gardnerlhwrc_0-1646994830621.png

    Then i get this error 

    Unable to process template language expressions in action 'Get_items' inputs at line '0' and column '0': 'The template language expression 'formatDateTime(item()['PermiteEndDate'],'yyyy-MM-dd')' cannot be evaluated because property 'PermiteEndDate' cannot be selected. Please see https://aka.ms/logicexpressions for usage details.'.

     

    Now that column in 100% in my list and in the old flow it would work. (changed format of the date to see if that helped.) Just not sure because its erroring at the 'Get Items' step is why its not working.

     

  • Verified answer
    fchopo Profile Picture
    8,003 Moderator on at
    Re: Adding multiple SP list items to HTML with conditions

    Hi @Anonymous 

    The expression should be: 

    PermiteEndDate eq 'addDays(utcNow(),1,'yyyy-MM-dd')'

    Please, pay attention to the single quote before and after the "addDays" expression.

    Hope it helps!

    Ferran

  • Community Power Platform Member Profile Picture
    on at
    Re: Adding multiple SP list items to HTML with conditions

    You my friend are an absolute legend! If you was here I would buy you a beer or which ever beverage you prefer. 

     

    Thank you very much. Have a good Friday and weekend.

  • Community Power Platform Member Profile Picture
    on at
    Re: Adding multiple SP list items to HTML with conditions

    @fchopo, I feel so bad to come back to you again. but 1 last question I promise. 

    So I have exactly the same flow but I'm a bit dumb so when Due date or Expiry date is a Monday i want email to be sent on Friday. Can I use the Get Items filter to help with this. I was thinking of something like this.

     

    PermiteEndDate eq '@{addDays(utcNow(),1,'yyyy-MM-dd')}' and '@{dayofWeek(utcNow())}' eq 1

     

    gardnerlhwrc_1-1646998727820.png

     

    Was merely wondering if the filter allows for 'and' expression. 

     

    Thanks L

  • Community Power Platform Member Profile Picture
    on at
    Re: Adding multiple SP list items to HTML with conditions

    Dont worry I sorted it. Needed to use dayOfWeek(utcNow()) as a control rather than in the filter query

     

    gardnerlhwrc_0-1647009666070.png

     

  • Community Power Platform Member Profile Picture
    on at
    Re: Adding multiple SP list items to HTML with conditions

    I guess even better solution now I think of it would of been to just to allow this flow to run on Fridays only, then no need for extra control....well there's 3 hours I wont get back...

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
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard