cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CricketCO
Helper I
Helper I

The power flow's logic app flow template was invalid

I am running into the following error when building a flow (this is my first time using Power Automate, so I may be making a silly error):

CricketCO_0-1636559307130.png

If the image is too small, this is what the error says: The power flow's logic app flow template was invalid. The template condition expression 'next review date' at line '1' and column '3933' is not valid template language expression.

 

What I'm trying to do:

  • Have SharePoint send an automated message to the user I have designated as the "content owner" for the file only when a field called "Next Review Date" is reached.
    • "Next Review Date" is auto-calculated as 180 days from another field, "Last Reviewed Date."

These are the earlier steps in the flow that were not expanded in the screenshot above:

CricketCO_1-1636559585618.png

 

2 ACCEPTED SOLUTIONS

Accepted Solutions

@CricketCO 

So, you probably want to structure you Flow with a Schedule trigger that is set to fire once a day.  Then use a SharePoint Get files (properties only) action with a filter query.

Filter query column references need to use that columns internal name (not the display name which can have spaces).  One way that usually works to find a columns internal name is to go to the list settings and click on the column.  The internal name will be in the URL after Field=.  

image.png

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

Hey @ScottShearer , I just wanted to update you that I have this working now. The trick seemed to be switching out the action in that last step from "Mail" to "Office 365 Outlook." This is what I have in there now:

CricketCO_0-1636672658099.png

 

Now that I am not quite as big of a novice as I was yesterday, I am seeing that is the icon you had in your answer too. I just didn't notice the difference when you initially posted it since I was focused on the prior steps.

 

Thank your for all of your help along the way.

View solution in original post

13 REPLIES 13
ScottShearer
Super User
Super User

@CricketCO 

Try replacing what you have in the Get file properties action for Id by selecting ID from Dynamic properties.

 

I notice that you are using the For a selected file trigger.  This will run the Flow immediately, check your condition and take action as appropriate.  Is that what you want or do you want a Flow that checks all the files every day?

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Thanks, Scott. I want a flow that checks the files every day. I was testing it out on one file for which I am the content owner, but I would like to apply it to most files in my SharePoint site and have it run daily.

What would I need to do to make that happen?

@CricketCO 

So, you probably want to structure you Flow with a Schedule trigger that is set to fire once a day.  Then use a SharePoint Get files (properties only) action with a filter query.

Filter query column references need to use that columns internal name (not the display name which can have spaces).  One way that usually works to find a columns internal name is to go to the list settings and click on the column.  The internal name will be in the URL after Field=.  

image.png

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
CricketCO
Helper I
Helper I

Thanks again. I have it saved with no errors, and I modified a file to have yesterday be the "next review date." Now I wait for the flow to do its automated run and see if it works. I just applied it to a folder for which I am the content owner of every file to test.

@CricketCO 

There is no need to wait - you can test now.  After you save your Flow, go to the top right corner while you have your Flow in edit mode and click on "Test".

image.pngimage.png

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
CricketCO
Helper I
Helper I

I tried that when I was initially editing. This is what I got:

CricketCO_0-1636567713097.png

 

I assumed it was related to it being a flow that is triggered to run once/day. If it doesn't run tomorrow, I'll let you know.

 

ScottShearer
Super User
Super User

@CricketCO 

That's because you were using a for a selected item trigger.  If you use a Recurrence (or almost any other) trigger, this will work for you.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
CricketCO
Helper I
Helper I

Got it; I just tested it, and unfortunately it failed. Could you give me more information about this "filter query" field:

CricketCO_1-1636572197685.png

 

This is what I have in the field:

CricketCO_9-1636573524491.png

 

I changed your "-180" to "-5" because I don't want to start notifying people to review their files as soon as they're loaded. The purpose of the "next review date" field is that it auto-calculates as 180 days from the "last reviewed date" and then people get notified when "next review date" is coming close. I do see how I could use "last reviewed date" +180 for the same effect in the formula too.

 

This is the error I received:

CricketCO_6-1636572962871.png

I then tried switching the formula to (I also tried "equal to"):

CricketCO_7-1636573270364.png

That just told me that, "The expression "Next Review Date equals '2021-11-05'" is not valid. Creating query failed." when tested.

I'm sorry to be such a novice at this!

 

@CricketCO 

Next Review Date is not the internal name of that column.  Go to the list settings in SharePoint and click on the Next Review Date column.  The Internal name will be at the end of the URL after Field=.  Use the internal name in your filter.  

You must use eq for equals or for greater than or equal to.

Here is a link to a really good blog post on filter queries.

If Next Review Date is not a calculated column, that should work for you.

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
CricketCO
Helper I
Helper I

@ScottShearer , I am feeling truly guilty for bugging you so much! 

I've got the "equals" piece fixed to ge using the blog post you provided - thanks!

 

I found and updated the internal name of the column using your instructions - thank you for that too!

 

That all seems to be running now, but it is having an issue in the mail step:

CricketCO_0-1636575870583.png

 

I went to the /connectors/sendmail/ page linked in the error details. I followed the process to subscribe to mail (I am the only one these emails would have gone to and all three that show as failing have my email address in the "to" line). I then retested and got the same result - mail failed.

 

We are not on GCC High or any of the other excluded regions or instances.

 

Would my best bet at this point be to work with my company's IT dept to confirm we are not blocking the IP address?

ScottShearer
Super User
Super User

@CricketCO 

Can you post a screen shot of the Send an email notification action in edit/design mode so that I can see how it is configured?

Also give it a try with the standard send an email action as a test.  Some organizations block the Send an email notification action.

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Is this what you are looking for in the screenshot?

CricketCO_0-1636576937995.png

The dynamic content in the "To" field is "Content Owner Email." 

 

In the failure report, I can see my correct email address in the highlighted (and blacked out) field here:

CricketCO_1-1636577202113.png

 

Hey @ScottShearer , I just wanted to update you that I have this working now. The trick seemed to be switching out the action in that last step from "Mail" to "Office 365 Outlook." This is what I have in there now:

CricketCO_0-1636672658099.png

 

Now that I am not quite as big of a novice as I was yesterday, I am seeing that is the icon you had in your answer too. I just didn't notice the difference when you initially posted it since I was focused on the prior steps.

 

Thank your for all of your help along the way.

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.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (2,150)