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 / Planner Create a task ...
Power Automate
Answered

Planner Create a task - Schema validation has failed

(0) ShareShare
ReportReport
Posted on by 265

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
     

 

Categories:
I have the same question (0)
  • LeeHarris Profile Picture
    1,026 on at

    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/84101
  • tested1 Profile Picture
    265 on at

    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

  • LeeHarris Profile Picture
    1,026 on at

    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

  • tested1 Profile Picture
    265 on at

    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
  • Verified answer
    LeeHarris Profile Picture
    1,026 on at

    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'])

  • tested1 Profile Picture
    265 on at

    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

  • LeeHarris Profile Picture
    1,026 on at

    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/

  • tested1 Profile Picture
    265 on at

    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

  • LeeHarris Profile Picture
    1,026 on at

    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

  • tested1 Profile Picture
    265 on at

    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.

     

     

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard