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 Apps / Calculate MD5 hash for...
Power Apps
Answered

Calculate MD5 hash for a text field similar to SQL HASHBYTES

(0) ShareShare
ReportReport
Posted on by 256

Hello,

 

Is there a way to get an MD5 hash for a text field?

In SQL there is a way to convert a text to an MD5 hash using something like this:

 

 

SELECT CONVERT(VARCHAR(32), HASHBYTES('MD5',CONVERT(NVARCHAR(32),'abcd')),2) as HashString;

 

 

and the result would be "E4A5FC25F9BBE59EC5606FB8FC093C75"

 

How I could achieve the same result in Power Apps?

 

Kind Regards,

Lucian 

Categories:
  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @Lucian

     

    There is no functionality to convert a text to MD5 Power Automate or PowerApps.

     

    Another option is to use a lightweight Azure function that converts and returns it. We can easily use it on Power Automate.

     

    Note: I have done similar functionality using this same approach

     

    This idea is already posted 

    https://powerusers.microsoft.com/t5/Power-Automate-Ideas/Ability-to-create-an-MD5-hash/idi-p/43644

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @Lucian 

     

    Please let us know if anything needs on your post. We can help with this.

     

    "Please do not forget to give kudos if you find the suggestion helpful or Accept it as a solution if works fine to help other users to find it useful. "

     

     

  • Lucian Profile Picture
    256 on at

    Hi @StalinPonnusamy 

     

    Thank you for your suggestion. I have found useful that idea, especially that "write code" option for custom connectors, and I hope the good guys from that thread - @ValentinGasenko and @maksii could provide a step by step using directly that option.

     

    Kind Regards,

    Lucian

  • Verified answer
    Lucian Profile Picture
    256 on at

    Hi @StalinPonnusamy 

    The full working samples were posted by @ValentinGasenko and @maksii in two threads:

    -one mentioned by you : https://powerusers.microsoft.com/t5/Power-Automate-Ideas/Ability-to-create-an-MD5-hash/idi-p/43644

    - second one with similar request/idea: https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Function-to-encrypt-hash-sha512-sha1-sha256-MD5/idi-p/449377

     

    One is using "custom connector with Azure Functions", and the other is using "custom connector with the new Write Code" option.

     

    Kind Regards,

    Lucian

  • vgarcia Profile Picture
    11 on at

    Hi!

     

    First of all thanks for the incredible work behind this trick 😉

     

    I just test it, but it doesn't work as I expected. In my case a need the MD5 of a JSON string. So when I sent the string to the connector, some characters change.

     

    Example:

    flow.png

    Any idea to fix it?

    Thx!

    flow.png
  • Lucian Profile Picture
    256 on at

    Hi @vgarcia ,

    One idea to test is to base64 encode the JSON, then hash that encoded string.

    Kind Regards,

    Lucian

  • vgarcia Profile Picture
    11 on at

    Hi @Lucian

     

    I tested your idea and it works.

    If someone have the samme issue, just made the following change, and send the string in BASE64.

    Screenshot 2021-09-07 123849.png

     

    Thx!

  • Lucian Profile Picture
    256 on at

    Hi @vgarcia ,

    Good to know it works that way either, but what I had in mind, was an step/action in Power Automate to convert the JSON to base64, then send that encoded string to the MD5 connector without modifying the code inside the connector. 😉

    Kind Regards,

    Lucian

  • vgarcia Profile Picture
    11 on at

    Hi @Lucian 

    I tested in this way, but the connector transform the base64 string so the md5 in the reply is different than the md5 of the original string.

    BR

  • zoxee Profile Picture
    3 on at

    Something is wrong on your end.

    MD5 for 'abcd' is "E2FC714C4727EE9395F324CD2E7F331F", not "E4A5FC25F9BBE59EC5606FB8FC093C75".

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard