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 / Having Trouble getting...
Power Automate
Unanswered

Having Trouble getting A sharepoint List Item Value.

(0) ShareShare
ReportReport
Posted on by

Hello,  I am fairly new to PowerAutomate.  Here is what I am trying to do.   I have a list of expiring workstations.  

 

Ive attempted this multiple ways and cannot seem to come up with a correct solution.  

 

baileyerw_0-1678731858048.png

My last attempt, I created a flow, to trigger once a day at 1 AM.  

 

Here is the result.  

baileyerw_1-1678732428343.png

My flow  - what i am trying to do is, Get contents of the Sharepoint list, It automatically adds the "Apply To each" so i go with it, and put my condition in. Days Left on Lease is less than or equal to 90

 

If yes, send an email.  

 

baileyerw_2-1678732573180.png

 

Any assistance would be greatly appreciated  

Categories:
I have the same question (0)
  • David_MA Profile Picture
    12,908 Super User 2025 Season 2 on at
    Re: Having Trouble getting A sharepoint List Item Value.

    As the error message states, the value from your SharePoint list is returning a string. To use it in the condition, it needs to be an integer. This is easily reproduceable with a button flow that has a text input where I enter a number:

    David_MA_0-1678733509186.png

    So that it works, use an expression to convert your SharePoint list value to an integer:

    David_MA_1-1678733594519.png

     

    Of course, if the list item actually contains anything but a number, then the expression will fail also with this error instead:

    Unable to process template language expressions for action 'Condition' at line '0' and column '0': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.

     

  • Community Power Platform Member Profile Picture
    on at
    Re: Having Trouble getting A sharepoint List Item Value.

    David,  thank you.  This pushed me in the right direction.    What do I need to replace 'text' with if I am pulling a value from Sharepoint?   I would assume the Column name in the list?   

  • grantjenkins Profile Picture
    11,063 Moderator on at
    Re: Having Trouble getting A sharepoint List Item Value.

    I'd actually question what the flow is currently doing and if that's what you actually want. At the moment, Eric is going to get multiple emails (one for each overdue workstation) every single day. If a lease is 89 days it will send an email, if tomorrow it's 88 days, another email, 87 days, another email, etc.

     

    What might be a better option is to bundle all the overdue workstations together into a single HTML Table and send just one email to Eric daily.

     

    Below is how I'd probably build the flow based on what I mentioned above.

     

    For this example, I have the following SharePoint List. Days Left On Lease is a Calculated Column as you already have.

    grantjenkins_0-1678884617027.png

     

    See full flow below. I'll go into each of the actions.

    grantjenkins_1-1678884659018.png

     

    Recurrence is set to run daily at whatever time you want to send out the email.

    grantjenkins_2-1678884694064.png

     

    Get items uses the following Filter Query to return items that are less than or equal to 90 days and sorts the items by DateLeaseExpires.

     

    Note that Get items will only return the first 100 items by default. We can easily increase this to 5000 items by setting the Top Count (not sure how many items you are expecting to be returned).

     

    Also note that your internal column names might be different to what I have below - you'll need to ensure you use whatever you have in your list.

    DateLeaseExpires le '@{addDays(utcNow(), 90, 'yyyy-MM-dd')}'

    grantjenkins_3-1678884826988.png

     

    Create HTML table uses the output from Get items and maps the Title, Date Lease Expires and Days Left On Lease. It uses the following expression to remove any decimal places that Power Automate sometimes adds.

    //You'll need to ensure you use the internal column name you have on your list
    
    formatNumber(float(item()?['DaysLeftOnLease']), 'N0')

    grantjenkins_4-1678884959007.png

     

    Style HTML table is a Compose action that contains some CSS for styling the HTML table, so it looks nicer in the email.

    <style>
     table {
     border-collapse: collapse;
     }
     table td,
     table th {
     border: 1px solid #ddd;
     padding: 6px 20px;
     text-align: left;
     }
     table th {
     background-color: #1C6EA4;
     color: white;
     }
    </style>

    grantjenkins_5-1678885015550.png

     

    Send an email will send just the one email to Eric (in your case) with a table of all the workstations that are expiring. It uses the output from Style HTML table and Create HTML table.

    grantjenkins_6-1678885085631.png

     

    After the flow runs, we would get an email similar to that shown below.

    grantjenkins_7-1678885158319.png


    ----------------------------------------------------------------------
    If I've answered your question, please mark the post as Solved.
    If you like my response, please consider giving it a Thumbs Up.

  • David_MA Profile Picture
    12,908 Super User 2025 Season 2 on at
    Re: Having Trouble getting A sharepoint List Item Value.

    I think you are referring to 'text' in my screen shot from my prior post. If so, in the expression bar enter int() then switch to the Dynamic content tab and select the field that contains the value:

    David_MA_0-1678886549759.png

    Make sure your cursor is between the parentheses when you select the field. It will then correctly populate your expression.

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