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

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Bug - Wrong auto code formatting

(0) ShareShare
ReportReport
Posted on by 1,594

Hi PowerApps team,

Here is a little code formatting bug I have encountered recently when using the Format text button in the code editor...

This formats fine:

Image 5.png

But if you add a comment before the second operation of the 'true part' of the condition, then it formats this way:

Image 6.png

Just wanted to let you know so you can provide a fix.

See you around...

Emmanuel

Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    on at
    Re: Bug - Wrong auto code formatting

    Hi @R3dKap ,

    Based on the needs that you mentioned, I have made a test, and the issue is confirmed on my side.

     

    I think this issue may be related to Format Text functionality in Formula bar within PowerApps. If you would like this feature to be improved, please consider submit an idea to PowerApps Ideas Forum:

    https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

     

    As an alternative solution, you could also consider format your formula within the Formula bar manually.

     

    Best regards,

  • R3dKap Profile Picture
    1,594 on at
    Re: Bug - Wrong auto code formatting

    Hi @v-xida-msft,

    Thanks for your feedback... When using the Format Text feature, the code formatting should be correct in terms of indentation. But as you noticed, in some cases, it doesn't.

    So, my point is: it is not a new idea, it is a bug.

    How are real confirmed bugs handled by PowerApps team ? Are we supposed to create ideas for these bugs ? I wouldn't see the logic in this...

    Waiting for your opinion on this... 🙂

    Emmanuel

  • Verified answer
    Mr-Dang-MSFT Profile Picture
    on at
    Re: Bug - Wrong auto code formatting

    Hi @R3dKap, thanks for the heads up. I've communicated this to the right team. 👍

     

    + @Anonymous 

  • AAAAA12345 Profile Picture
    5 on at
    Re: Bug - Wrong auto code formatting

    This bug is still out there as of 5/20/2024. When will it get fixed?

     

    AAAAA12345_0-1716231784213.png

     

  • subsguts Profile Picture
    1,259 Moderator on at
    Re: Bug - Wrong auto code formatting

    This is NOT a solution and 5 years later this is still an issue.  

     

    It is a best practice to add comments to your code, however in doing so it destroys your the readability of your code.

     

    This is a huge BUG and major miss by MS.  Why this hasn't been corrected in 5 years, I have no idea?

     

    Also, the idea in another post no longer exists so it was remove without the problem being addressed?

     

    Come on MS, this should be seen as a black eye and one you should have fixed years ago.  Surely the Format can ignore comments?

     

    I'm sure this will fall on deaf ears, but at least I feel a little better posting... well maybe not that much 🙂

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 671 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 424 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 243

Last 30 days Overall leaderboard