Using GenAI to Clean Up Your Power App Naming Conventions

What

Providing you, a Power App developer, with the steps to quickly apply theming and naming conventions to all fields within your app, by utilising any GenAI tool.


Why

After a swift session of adding labels and text boxes and such to your app, and nicely theming one, but then having to apply all the values to other fields, your app probably looks something like this.

 

At this point, if you are like me, your next steps are:

  • clean up field names
  • re-order tree-view from top to bottom
  • ensure theming matches throughout

Depending on the complexity of the app, doing a good job of this could take a whole day.

How

  1. Add all your fields to your app
  2. Theme one perfectly
  3. 'View Code' on the Screen and Copy the YAML to Notepad
     
  4. Open up your preferred GenAI tool - for this exercise I'm using https://claude.ai/ 
  5. Enter the following Prompt, before pasting in the code you copied from step 3:

    I've just built a Power App, but need your help with the following:
    1. Naming fields appropriately: Use the text from the 'Name' column to update the object name (e.g. Label1).  Should follow standard object naming convention like this: txt_Name for TEXT control, or lbl_ for label, or cmb_ for Combo box, etc.  If an object does not have a 'Text' value because it's not a label, then it's name should mimic the label that is sitting next to it in the same Y position.
    2. re-ordering all the fields as they appear on the screen, from top to bottom: The code you provide back should ensure fields are ordered in the tree view from bottom right to top left (as the YAML is in the reverse order that they appear in the tree view).
    3. Applying the same theme that's been applied to Label1 and TextInput1 - e.g. background colours, text colours, borders, etc
    4. Make sure the code provided back to me is in the same format as I provided


  6. Take the code generated, click the screeen '...' and select 'Paste > Paste code'


  7. The Results:
     

Final Thoughts

There's still a couple of extra prompts I could add to make this even better, but I think what I've written above I'll reference to quickly build a quality named/ordered/themed app quickly.

Also, I have tried this with simpler prompts, and it works just as well.  The prompt above just covers that next level of detail and is a little bit clearer to ensure the output is more reliable/consistent.

Example: Here's a simpler one I used that worked fine too:

Have you attempted this?  How we're your results?


Comments

Popular posts from this blog

How to Copy/Duplicate a Table and Columns in a Dataverse Environment

Microsoft Flow - Apply To Each Limitation (5000 items)

Export Group Membership From Active Directory Using Power Query