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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Recognize entities in ...
Power Automate
Unanswered

Recognize entities in text Date time error

(0) ShareShare
ReportReport
Posted on by 208

The "Recognize entities in text" action, when configured with Entity type "Date time" and passed a valid string, sometimes returns an error "Runtime Error: The string was not recognized as a valid DateTime."

 

This occurs sporadically, but it's frequent enough that I've had to abandon the action and resort to developing a custom subflow to find a date in text.

 

Especially confounding is the fact that the documentation reports the action doesn't include any exceptions, so any error handling has to be custom, as well: Text actions reference - Power Automate | Microsoft Learn

I have the same question (0)
  • VJR Profile Picture
    7,635 on at

    Hi @joelzehring 

    Can you share the input datetime along with the format you are using and let me try out and see what happens?

    You can even paste your action here so that I can quickly paste it onto my PAD editor 😉

     

  • joelzehring Profile Picture
    208 on at

    Hi @VJR 

    Unfortunately, the input text I'm using is provided dynamically by a preceding action... And it's not logged due to the sensitive nature of the text. When I reproduced the issue using data from a failed transaction and examined the text, it was indeed valid. During a flow run with about 600 transactions, this error occurred around 20 times.

     

    Please see below for an example of the activity:

    Text.RecognizeEntitiesInText Text: $'''text''' Mode: Text.RecognizerMode.DateTime Language: Text.RecognizerLanguage.English RecognizedEntities=> RecognizedEntities

     

  • VJR Profile Picture
    7,635 on at

    Hi @joelzehring 

     

    The above code generated the below screenshot.

    But I cannot evaluate the output without the input you are seeing in the Flow.

    Are you able to do a manual run, put a breakpoint, grab the datetime and post it here, so that I can take a look?

     

    VJR_0-1673751926009.png

     

  • joelzehring Profile Picture
    208 on at

    Hi @VJR.

     

    The input text is actually free-form text extracted from a document using the Azure Form Recognizer service. It's not a single datetime string, but a string that usually contains one or more datetime substrings.

     

    The "Text to recognize from:" field accepts a string and attempts to find "Entity type" substrings within the string. In this case, substrings matching a "Date time" format. In most transactions, this action returns a datatable with zero, one, or more rows. Each row includes a field for the substring in the source text which matches a datetime format. Another field in the row includes the datetime value of the substring.

     

    I'm never passing a simple datetime string, nor am I passing an empty string. In transactions where a datetime substring is not present in the source text, the action should return a datatable with zero rows. This happens most of the time, but occasionally, the action throws the above error.

  • VJR Profile Picture
    7,635 on at

    Hi @joelzehring 

     

    The input text is actually free-form text extracted from a document using the Azure Form Recognizer service. It's not a single datetime string, but a string that usually contains one or more datetime substrings.

     

    Even if the input text having the datetime strings is coming from any other service you will be able to put a breakpoint before the Recognise entities and get the text that is going inside the Recognise entities. If you share with me that text after removing any sensitive information then I will be able to run it and see the error.

     

    If you are not able to put a breakpoint because you are running it in unattended mode, then just write that text to a notepad file before passing it to Recognise text and share it.

     

    I just needed you to save that text and share it to review the issue on my side and suggest any solution or rectify what is going wrong.

  • joelzehring Profile Picture
    208 on at

    I'm unable to share the text here. Thanks for your offer to help. Hopefully the Power Automate Desktop team can identify the bug causing this error.

  • VJR Profile Picture
    7,635 on at

    Hi @joelzehring 

    Okay 🙂 just wanted to say this....that you can still post the text without the sensitive information

    something like...

     

    xxxxx 18-01-2023 yyyy

    zzzz19-01-2023

     

    I will still be able to run it via the recognise entities because as you said its just the date causing the problems.

     

    But anyways I will leave it to you 🙂 ....so good luck 👍 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 1,027

#2
Valantis Profile Picture

Valantis 815

#3
Haque Profile Picture

Haque 630

Last 30 days Overall leaderboard