Variable Prefix Customization
Customize the naming conventions used in generated YAML code. Match your team's standards automatically.
What is This?
Every Power Apps control needs a unique name. PowerLibs generates names like lblTitle, btnSubmit, conSidebar with consistent prefixes. The Variable Prefix feature lets accounts with a paid plan other than the old Components subscription change these prefixes to match their own conventions.
Default prefixes:
lblfor Labelsbtnfor Buttonsconfor Containersicofor Iconsimgfor Imagesgalfor Galleriestxtfor Inputs (text boxes)varfor local variablesgblfor global variables
Your custom prefixes might be:
_lbl,_btn,_con(underscore style)label_,button_,container_(descriptive)
Why Use Custom Prefixes?
Team Standards
Most development teams have naming conventions. If your team uses _ prefixes or Hungarian notation, you can match that.
Consistency
When everyone on the team uses the same prefixes, code reviews are easier and components work better together.
Personal Preference
Some people prefer txtName while others like input_Name. Now you can choose.
How to Set Up
1. Open Settings
Open your account menu in the header and click Settings.
2. Find Variable Naming Section
Scroll to the "Variable Naming" section in the settings panel.
3. Customize Prefixes
You'll see input fields for each prefix type:
| Type | Default | Example Control Name |
|---|---|---|
| Label | lbl | lblTitle |
| Button | btn | btnSubmit |
| Container | con | conSidebar |
| Icon | ico | icoMenu |
| Image | img | imgLogo |
| Gallery | gal | galItems |
| Input | txt | txtName |
| Variable | var | varSelected |
| Global | gbl | gblDarkMode |
4. Save Changes
Click "Save Changes" and the page will reload. All future YAML generations will use your custom prefixes. A prefix can be up to 20 characters long.
Examples
Underscore Style
Set all prefixes to include an underscore:
- Label:
_lbl - Button:
_btn
Result: _lblTitle, _btnSubmit
Descriptive Style
Use full words:
- Label:
label_ - Button:
button_ - Container:
container_
Result: label_Title, button_Submit, container_Sidebar
Common Team Standards
Different organizations use different conventions:
Microsoft Standard:
lbl,btn,txt,gal,con
Underscore Hungarian:
_lbl,_btn,_txt
Snake Case:
lbl_,btn_,txt_
Important Notes
Applies to New Generations Only
Changing prefixes affects future YAML generations. Already-generated code keeps its original names.
Most Names Use Your Prefixes
Once set, your prefixes are used for the labels, buttons, galleries, containers, icons, images, text inputs and variables of the components in the library. You don't need to configure per-component. Some names stay fixed:
- Timers have fixed names without a prefix, for example
ToastAutoHide. - Shapes and a few other control types have no prefix field. Rectangles keep
rec(for examplerecFormDrawerScrim), and sliders, ratings, attachment controls and pen inputs keep their own fixed names, such assldSlider. - Some full apps keep their own names: the Helpdesk, Approvals and Project Management apps, and the Product Catalog and Add Item pages of the Inventory app.
- A few variables are fixed, for example
varSidebarin the Collapsible Sidebar andvarSelectedTimein the Time Picker. The component guides name these exceptions.
Stored With Your Account
Prefix settings sync across devices. Log in on a new computer and your settings are there. They are saved with your active project, so each project can have its own prefixes. With several projects you can also set them in the New Project and Edit Project dialogs; see Projects.
Other Accounts See Defaults
Custom prefixes apply with a paid plan other than the old Components subscription. Every other account always gets the default prefixes in generated code, even if custom values were saved earlier. Where such an account sees the prefix fields (in Settings, or in the New Project and Edit Project dialogs), they are greyed out, and a click on them opens the plan options. See pricing.
The Variable Prefix feature is designed for power users and teams with established coding standards. If you're working alone or just starting out, the defaults are perfectly fine.