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 / Access the react code ...
Power Apps
Answered

Access the react code in custom power apps page

(1) ShareShare
ReportReport
Posted on by 17
While I was debugging, I accidentally turned on a boolean variable in code that opens a modal window in my custom power apps page. Now whenever I click on that page in the navigation bar, the modal window appears constantly and I am unable to see edit code button to edit the code. How can I then access my react code ? Everything behind the modal is greyed out and I cannot even click anywhere.
 
Categories:
I have the same question (0)
  • Suggested answer
    Sunil Kumar Pashikanti Profile Picture
    2,318 Moderator on at
     
    You are not actually locked out. The easiest fix here is to restore a previous version.

    In your screenshot, the left panel already shows version history with a Restore button. Click Restore on a version before the modal change and save. This will remove the modal issue immediately.

    If you want another option, open the custom page from the Maker Portal in edit mode instead of running the app. That bypasses runtime logic so the modal will not block the UI.

    For future safety, avoid auto opening a modal on load without a guard. Use a query parameter or a debug flag so you can always control when it appears.
     
    ✅ If one of the responses here solved your issue, please mark it as Accepted so others facing the same problem can benefit as well.
    👍 If this or any other reply here helped you, feel free to give it a Like. It helps others and is always appreciated.

    Sunil Kumar Pashikanti, Moderator
    Blog: https://sunilpashikanti.com/posts/
     
  • Suggested answer
    Valantis Profile Picture
    6,735 on at
     
    Two additional options if you want to fix the code directly without restoring:

    1. Open the custom page in the Code Editor directly via the maker portal. Go to make.powerapps.com > Apps > find your app > select the three dots > Edit. Then in the editor, navigate to the custom page via the left panel without running it. The Code Editor opens in edit mode, not run mode, so the modal's runtime logic doesn't execute.

    2. Use pac power-platform CLI to export the app (pac app export), edit the React code file locally in VS Code to set your boolean variable back to false, then push it back (pac app import). This is the Code Apps authoring pattern and bypasses the in-browser editor entirely.

    For the future: initialise modal-triggering variables from environment variables or URL parameters rather than hardcoded booleans, so you can always override them without touching the code.
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

    💼 LinkedIn

    ▶️ YouTube

  • Verified answer
    GK-07011449-0 Profile Picture
    17 on at
     
    Thank you for your response. The modal had blocked everything behind it and nothing was clickable. So I could not use the Restore option.
     
    The other option that you suggested is available for canvas apps. Mine is custom page written by copilot.
     
     
    Thank you for you response. Your first suggestion is available for canvas apps. I did not try the second option.
     
    What I did:
    I exported my solution. I then added a new custom page and pasted the code from the tsx file present in the exported solution. This helped me to edit the code and later I removed the original faulty page.
  • Valantis Profile Picture
    6,735 on at
     

    Just wanted to check in and see if everything is working now. If you still need any help, feel free to let me know.

    Also, if the issue is resolved, it would be great if you could mark the answer as solved so others with the same question can find it easily.

     

    Thanks and have a great day!

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard