cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Matt22365
Helper III
Helper III

Getting an error on 1 flow which doesnt appear in another identical one

Hi

I have 2 flows set up to email specific people when various sharepoint lists are added to

Both Flows are exactly the same apart from each one is linked to a different list

I have started getting the following error on one of the lists:

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

I use the Int to convert a calculated value so I can use it as a condition

 

I have tried recreating this path of the flow but that did not fix the issue. I have also tried in incognito mode as that was some other advice I found after a quick google, neither have helped

 

Any advice would be greatly appreciated

 

Matt 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi, I found a way round the issue, hopefully this helps if anyone has a similar issue

 

The issue was something to do with using an INT for a number which is the output of a calculation.

I wanted to use the automate "is less than" function to drive whether the next step should happen but this was causing the flow to fail

 

So the way round this is to add a new calculated column in the sharepoint list to convert the number to a word i.e. =if(Column X < 365, "Yes","No"). Then use the word "Yes" as a condition rather than the number.

 

This has fixed my issue

 

Hope it helps someone

 

Matt 

View solution in original post

10 REPLIES 10
manuelstgomes
Community Champion
Community Champion

Hi @Matt22365 

 

The issue is that the value that is being passed to the int function is somehow invalid.

Can you please add a "compose" action and add the value or expression that you're using inside the compose? Then we can see the value before and why it's giving an error when converting to int.

 

Cheers
Manuel

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

Hi @manuelstgomes 

The int is:

int(triggerOutputs()?['body/Deadline_x0020_period_x0020__x00'])
with the "Deadline period (days)" being the dynamic content
 
Is the "(days)" causing an issue as that part of the dynamic content isnt appearing in the above calculation?
 
Not sure where to add the compose action, is this before or after the condition action?
 
Thanks for your help
manuelstgomes
Community Champion
Community Champion

Hi @Matt22365 

 

Could be but we can do the following:

1. Open your Flow.

2. In the Run history open one of them.

3. Open the trigger action

4. Check what's the output and try to locate the "Deadline period (days)"

5. Copy that into the "body/...." and you'll have the correct name of the field.

 

Cheers
Manuel

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

Hi @manuelstgomes 

I cant see an option to view the output, see attached picture

Thanks

Matt flow issue.PNG

manuelstgomes
Community Champion
Community Champion

Hi @Matt22365 

 

Click on the "When an item is created" and you'll be able to see that information.

 

Cheers
Manuel

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

Hi

I found it thank you

The output matches the int calculation:

Output - 

"Deadline_x0020_period_x0020__x00"

 int - 

int(triggerOutputs()?['body/Deadline_x0020_period_x0020__x00'])
 
Thanks
Matt 
manuelstgomes
Community Champion
Community Champion

Hi @Matt22365 

 

Ok good. What's the value that comes from the "When an item is created"?

Can you please check if there's any value that isn't an int?

The error message is a conversion error from something to int.

 

Cheers
Manuel

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

Hi

The value is

"Deadline_x0020_period_x0020__x00":"66.5167361111089"

This is a calculated field based on the difference between 2 dates in the list 

Thanks

Matt 

Hi @manuelstgomes , everyone

I am still having this issue, I dont suppose you have any further ideas on how to fix

Thanks

Matt 

Hi, I found a way round the issue, hopefully this helps if anyone has a similar issue

 

The issue was something to do with using an INT for a number which is the output of a calculation.

I wanted to use the automate "is less than" function to drive whether the next step should happen but this was causing the flow to fail

 

So the way round this is to add a new calculated column in the sharepoint list to convert the number to a word i.e. =if(Column X < 365, "Yes","No"). Then use the word "Yes" as a condition rather than the number.

 

This has fixed my issue

 

Hope it helps someone

 

Matt 

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 (3,350)