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 / PAD freezes when JavaS...
Power Automate
Unanswered

PAD freezes when JavaScript encounters special characters during JSON.stringify().

(1) ShareShare
ReportReport
Posted on by

Hi,

 

When I run JavaScript code on a web page, it causes freezing.

Specifically, if the retrieved characters contain special characters, the freeze occurs during JSON.stringify(). However, if I comment out that field, the freezing doesn't happen.

If the characters are converted to Unicode, the freezing is also avoided.

For example, these special characters will always cause a freeze:
1️⃣
2️⃣
3️⃣
4️⃣

1⃣
2⃣
3⃣
4⃣

----

Here is my js:

```

function ExecuteScript() {
    const blog_details = document.querySelector("xxx");
    const blog_content = blog_details.querySelector("xxx").textContent;
    const blog_date = blog_details.querySelector('xxx').textContent;

    const comments_total = document.querySelector("xxx").textContent;
 

    function escapeUnicode(text) {
        return text.split('').map(char => {
            const code = char.charCodeAt(0).toString(16).padStart(4, '0');
            return '\\u' + code;
        }).join('');
    }
    const escapedContent = escapeUnicode(blog_content);
    const result = {
        // blog_content: blog_content,  // freeze
        // blog_content: escapedContent  // no freeze
        blog_date: blog_date,
        comments_total: comments_total
    }
    return JSON.stringify(result);
}

```

 

Is there a better solution for this, or is it a bug? Running the same JavaScript in the browser works fine.

 

I have the same question (0)

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