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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Invalid Expression for...
Power Automate
Unanswered

Invalid Expression for Input Parameter

(1) ShareShare
ReportReport
Posted on by 6
I am trying to build a flow that runs once daily that checks the Due Date column in a SharePoint list for dates that are 10-days from today. The flow will then send an email to multiple people with the total number of items that meet that condition. Using Co-Pilot, I could get the flow to work without the total, thus receiving multiple emails. Whenever I add in the count, I get an error (see picture).
 
Does anyone have a Flow that will work? Or let me know what I can try to resolve the issue?
Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,452 Super User 2025 Season 2 on at
    Hi
     
    Hmm, we would need to see the inputs and values in the Foreach action please.
     
    Thanks,
     
  • DM-11101456-0 Profile Picture
    6 on at
    Let me know if this provides what you need. Still new to Power Automate.
     
     
     
     
     
  • Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at
    I see the expression of the Set Count action might be wrong. It looks like you used:
    add(variables_Count,1)
    The expression is trying to add a number to text, which will throw an error. Normally the valid way of writing that expression would be the below:
    add(variables('Count'),1)
    Based on your current expression it looks like you are trying to update the Count variable by incrementing the previous value with one.

    However, self reference is not supported when updating the value of variable like 'Count' in a set variable action.
     
    So, in your case try and replace the set variable action by a increment variable action with the below setup.
     
     
     
  • DM-11101456-0 Profile Picture
    6 on at
    That fixed that issue. Now, here is the last two things. On my list I have 3 items that meet the condition of the Due Date being 10-days from today. The flow is skipping the Item Count step stating, "the branching condition for this action is not satisfied." However, I did move the "Set ItemCount" to false, and the action succeeded.
     
    The second and final step is the body of the email is putting the formula to give the count, but not providing the count. Ideally, the body of the email will say something along the line of "There are XX calibrations due in 10-days."
     
        
     
     
          
     
     
     
  • Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at
    In that case try adding this expression:
    concat('There are ', string(variables('ItemCount')), ' calibrations due in 10-days.')
     

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
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard