18 September 2023
M Language is a powerful low-code programming language used to build custom logic across the Microsoft Power Platform. With M Language training, you can rapidly develop apps, automate workflows, and integrate systems without needing to be an expert developer. This beginner's guide will teach you the basics of M Language and how to get started with hands-on training to be used as a support resource to JBI Trainings Power BI - Power Query & M
M Language is the coding language behind Microsoft Power Apps, Power Automate, and other components of the Microsoft Power Platform. It provides a simple yet robust way to add custom logic and build solutions.
Some key things to know about M Language:
Learning M Language unlocks new possibilities for automating processes, building responsive apps, and getting more value from data. Even without an extensive coding background, you can quickly gain skills to enhance solutions on the Power Platform.
Taking dedicated M Language training as a beginner has several advantages:
Dedicated training delivers structure, support, and practice opportunities beginners need to gain proficiency in M Language.
While no prior coding experience is required to get started with M Language, having some background will help you get up to speed faster. Here are some recommended pre-requisites:
Even if you are new to some of these areas, you can quickly gain the necessary knowledge by completing online courses and tutorials before embarking on dedicated M Language training.
Before writing your first line of M code, you need to setup an environment with the right tools. Here are the steps to get setup for M Language development:
Visual Studio Code is a free, lightweight, open-source code editor with support for M Language.
This extension provides syntax highlighting, auto-completion, and other features for M Language files.
Now you need a project folder to store your M Language code files.
HelloWorld.m
.HelloWorld.m
and you're ready to start coding!With these basic steps, your M Language coding environment is ready to go!
Once your dev environment is setup, you can start learning the building blocks of the M Language:
Like other languages, M has common data types including:
Variables store values in memory during execution. Declare them before use:
myNumber = 10
myText = "Hello"
Expressions combine variables, values, and operators to produce a result:
fullname = "Mary" & " " & "Johnson"
Operators allow you to perform actions on data:
+
, -
, *
, /
>
, <
, =
&&
, ||
Use print
to output values and text into the console:
print "Hello World"
These fundamentals power much of the code you will write in M Language.
Beyond the basics, M gives you control over the flow of your program logic using statements like:
Execute different code blocks based on conditionals:
if x > 10 then
print "x is greater than 10"
else
print "x is less than or equal to 10"
Repeat code on each item in a collection:
for i in [1, 2, 3] do
print i
Repeat code while a condition is true:
while x < 10 do
x = x + 1
Stop execution and break out of the current loop.
Control flow statements allow you to build robust M Language solutions.
Functions are reusable blocks of code that perform specific tasks:
Use the function
keyword:
function addNumbers(x, y) {
return x + y
}
Pass parameters to execute the function:
sum = addNumbers(5, 10)
Functions help modularize your programs into logical components.
Tables store structured data in rows and columns. Use them to:
Common actions include:
Table.AddRows()
Table.Update()
Table.RemoveRows()
Lookup()
or Search()
Tables are a core concept for handling data in M Language.
Bugs happen - here are techniques to squash them in M Language:
Pause execution at specific lines to inspect state.
Step through code line-by-line to understand flow.
Check variable values and object structures at runtime.
Use print
to output checkpoints and diagnostics.
Robust debugging practices will accelerate your M Language development.
In apps, you need to capture user input and display outputs. Common techniques include:
Retrieve input from forms with functions like TextInput()
or DropDown()
.
Show user messages and visualizations with Notify()
or graphing functions.
Build interfaces with controls like Button
, Label
, Gallery
, and more.
Smooth user interactions will make your M Language programs intuitive and engaging.
Access external data to power your M Language solutions:
CSV.Document()
.Robust data connectivity unlocks the full potential of M Language.
Once you grasp the fundamentals, here are some recommended next steps:
Dedicated practice and linking up with the broader community will help take your M Language skills to the next level.
This beginner's guide introduced the major building blocks of M Language - from development environment setup to programming fundamentals to techniques for real-world applications. With this foundation, you can start applying M Language to build responsive apps, workflow automation, AI-infused solutions, and more across the Power Platform. Learning M unlocks a simpler yet powerful approach to meet your organization's needs.
The key next step is practicing these concepts through hands-on M Language training. Guided courses with sample projects will accelerate your learning. Be patient, ask questions, and keep coding as you uncover the possibilities with M Language!
If you enjoyed this article you might like to look at the following resource guide How to Get Started with M Language and Power BI
Some good starter projects include calculators, unit converters, simple games, polling/voting apps, expense trackers, and basic data entry forms. Start with the basics before moving to more advanced solutions.
No, you can leverage Power Apps, Power Automate, Power BI and other components through their graphical "low-code" interfaces without needing to write M code. But learning M vastly expands what you can develop.
Knowledge of JavaScript and C# can help you learn M faster. More broadly, skills in data, databases, APIs, Azure, Power Platform, and UX design will make you a well-rounded M Language developer.
Yes, you can self-study M Language through Microsoft's documentation, community forums, and free online resources. However, instructor-led training provides structure and guidance that accelerates learning. But we would always recommend starting off with one of our courses at JBI Training
CONTACT
+44 (0)20 8446 7555
Copyright © 2024 JBI Training. All Rights Reserved.
JB International Training Ltd - Company Registration Number: 08458005
Registered Address: Wohl Enterprise Hub, 2B Redbourne Avenue, London, N3 2BS
Modern Slavery Statement & Corporate Policies | Terms & Conditions | Contact Us