Skip to content

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:

  • lbl for Labels
  • btn for Buttons
  • con for Containers
  • ico for Icons
  • img for Images
  • gal for Galleries
  • txt for Inputs (text boxes)
  • var for local variables
  • gbl for 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:

TypeDefaultExample Control Name
LabellbllblTitle
ButtonbtnbtnSubmit
ContainerconconSidebar
IconicoicoMenu
ImageimgimgLogo
GallerygalgalItems
InputtxttxtName
VariablevarvarSelected
GlobalgblgblDarkMode

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.

Tip:
A blank field falls back to the default prefix. To shorten names, use a short prefix rather than none.

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 example recFormDrawerScrim), and sliders, ratings, attachment controls and pen inputs keep their own fixed names, such as sldSlider.
  • 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 varSidebar in the Collapsible Sidebar and varSelectedTime in 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.

Note:

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.

Variable Prefix Customization | PowerLibs