Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Answered

Random error 'JSON.stringify cannot serialize cyclic structures'

(0) ShareShare
ReportReport
Posted on by 35

Hi everyone!👋

 

About the app: Canvas Power App using a Custom connector for executing the post API method.

 

Problem:

I'm getting a random error on different days using mobile data (in desktop and wifi works fine now also the error was detected on desktop with wifi).

Aleatory error 'JSON.stringify cannot serialize cyclic structures'.

 

JsonError.png

 

The error was on trying to call the API (Executing the API post method) it failures random on different days only with mobile data.
I'm not using any JSON Functions or stringify explicit on the code. Maybe, Powerapps convert or use JSON.stringify internally for sending the information to the custom connector, but not syre.

 

Some details: pseudo-code

 

 

UpdateContext(
{
locResponse: CustomConn.PostMethod(
"application/json",
gblApiKey,
{
user: User().Email,
account: First(colInformation).account,
guid: GUID(),
submissionGUID: gblSubmissionGUID,
accountkey: First(colInformation).accountKey,
flag: If (CountRows(colInformationSelected)=0,false,true),
listString1: If (CountRows(colInformationSelected)=0,"",Concat(colInformationSelected,Text(key),Char(59))),
lastname: First(colInformation).lastname,
listString2: If (CountRows(colAdditionalInformationSelected)=0,"",Concat(colAdditionalInformationSelected,Text(key),Char(59))),
address: First(colInformation).address
}
)
}
);

 

 

- The collections with CONCAT where very simple (Key/Text) with 0 or 5 records. 

 

Do you have some similar errors? Or any thoughts?🤔

Or if someone has an idea about what is happening, it would be really great.

 

Thanks in advance

 

Best Regards,

Facu

  • Verified answer
    facupola Profile Picture
    35 on at
    Re: Random error 'JSON.stringify cannot serialize cyclic structures'

    Finally, I got the root cause of the error, it was a coding error. The App was trying to send on one parameter the whole control " [object Object] " instead of the Text.

     

    At future, It will be better to show a user-friendly error instead of the JSON.Stringify ones. Because Stringify is a component inside of PowerApps.

     

    Hope it would helps other people.

    Thanks

     

  • facupola Profile Picture
    35 on at
    Re: Random error 'JSON.stringify cannot serialize cyclic structures' with mobile data

    More related information. I added IfError, here are the details:

     

    FirstError.Kind: 23
    FirstError.Observed: SampleButton_131.OnSelect
    FirstError.Message: CustomConn.PostMethod failed: JSON.stringify cannot serialize cyclic structures.

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 109 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 82 Super User 2025 Season 1

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 72

Overall leaderboard