cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tested1
Helper V
Helper V

Planner Create a task - Schema validation has failed

Hello,  I have a flow to assign me a task in a shared planner board if the subject of an email contains a specific sentance. 

 

In the last step I want it to assign the body of the original email as the title on the planner board for the task

 

But I receive this error:

  • Schema validation has failed. Validation for field 'Title', on entity 'Task' has failed: The field cannot be longer than 255 characters.
    Is it possible to add a limit to the body to just show the first 255 characters on the planner board?
     
    P.s Is there no way to have the condition box bigger? I have a long formula in it which is very difficult to see
    Thanks
     
     
    1122error 1error 1error 2error 2
     

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @tested1

Looks like you just need to adjust it slightly from 

if(greater(length(triggerBody()?['Body']),255),substring(body,0,255),triggerBody()?['Body'])

to 

if(greater(length(triggerBody()?['Body']),255),substring(triggerBody()?['Body'],0,255),triggerBody()?['Body'])


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Follow me on Twitter at @QG_LeeJHarris

Or on LinkedIn at in/leejharris

View solution in original post

12 REPLIES 12
LeeHarris
Solution Sage
Solution Sage

Hi @tested1

 

Rather than using the Dynamic Content for Body in the Topic field you should instead be able to use the following expression.

 

if(greater(length(triggerBody()['text']),255),substring(triggerBody()['text'],0,255),triggerBody()['text'])
 
Replace triggerBody()['text'] with the Dynamic Content for Body. This will check if the body text is greater than the max size of 255, and if it is it will instead insert only the first 255 characters. Unfortunately there is currently no way to make the formula box bigger. There is a post in the ideas forum which you may want to upvote https://powerusers.microsoft.com/t5/Flow-Ideas/Increase-the-size-of-the-Expression-editor/idi-p/8410...

Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Follow me on Twitter at @QG_LeeJHarris

Or on LinkedIn at in/leejharris

Hi @LeeHarris

 

Is this what you mean? See pic.

 

I ran a test flow and still received the same error as before

 

dave 4.png

Hi @tested1

 

Not quite, you need to use the expression builder. You can insert your Dynamic Content into an expression as shown in the second gif below.

2019-02-12_17-05-03.gif

 

2019-02-12_17-05-53.gif


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Follow me on Twitter at @QG_LeeJHarris

Or on LinkedIn at in/leejharris

hi @LeeHarris

 

I typed this into the title using the expression and using the 'Body' from dynamic content but it said the expression is invalid?

 

if(greater(length(triggerBody()?['Body']),255),substring(body,0,255),triggerBody()?['Body'])
 
Is this what you mean? Thanks
 
dave 5.png

Hi @tested1

Looks like you just need to adjust it slightly from 

if(greater(length(triggerBody()?['Body']),255),substring(body,0,255),triggerBody()?['Body'])

to 

if(greater(length(triggerBody()?['Body']),255),substring(triggerBody()?['Body'],0,255),triggerBody()?['Body'])


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Follow me on Twitter at @QG_LeeJHarris

Or on LinkedIn at in/leejharris

View solution in original post

Thank you the help @LeeHarris !!

 

Just one last thing. When the body of the text comes up on the Planner, it seems to be like a HTML and has some other info before the body of the text. (See pic)

 

Is there a way to tidy this up or does the text need to be translated? 

 

P.S would it better to add a step to update the task details and then put the body of the email in the description? (Is there still a 255 character limit if this is done or would it sow the full email body?)

Dave 10.png

Thank you

Hi @tested1

 

It looks as though there is a new Action available in Preview for converting HTML text to plain text. You should be able to input your email body to this action and change the formula in your Create Planner Task action to use the output of the conversion instead of triggerBody()?['Body'].

 

https://docs.microsoft.com/en-gb/connectors/conversionservice/


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Follow me on Twitter at @QG_LeeJHarris

Or on LinkedIn at in/leejharris

Hi @LeeHarris

 

So would I add a html to text step before create a task in planner step?

 

Then I need to change the expression in the Title of create a task to include this Html to text step?

 

Do i need to put a different formula instead of the trigger body one or will it update to change it to text? 

 

Thanks

Hi @tested1

 

So would I add a html to text step before create a task in planner step? - Yes, add a new step for the conversion. Set the value to the email body from your Dynamic Content.

 

Then I need to change the expression in the Title of create a task to include this Html to text step? - Yes

 

Do i need to put a different formula instead of the trigger body one or will it update to change it to text? - Yes, replace all instances of your previous Dynamic Content (for body) with the new Dynamic Content for the output of the conversion.

 

Hope that helps


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Follow me on Twitter at @QG_LeeJHarris

Or on LinkedIn at in/leejharris

Hi @LeeHarris

 

Thank you. Do I just put the dynamic content as 'HTML to text'/the plain text content? in that formula so its like:

if(greater(length(body('Html_to_text_2'),255),substring(body('Html_to_text_2'),0,255)body('Html_to_text_2')
I think it said it is invalid when I tried that.

 

 

Hi @tested1

 

Try this, you appeared to be missing some formatting, brackets and commas etc.

if(greater(length(body('Html_to_text_2')),255),substring(body('Html_to_text_2'),0,255),body('Html_to_text_2'))


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Follow me on Twitter at @QG_LeeJHarris

Or on LinkedIn at in/leejharris

How do I add this into the condition fields?

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (68,820)