Acknowledging it early, yes, there is a Microsoft provided GUID() function already available in Power Fx. The function is handy and gets the job done. However, there are scenarios where makers may want to create their own GUID values. How? Well, nesting a small handful of Power Fx functions:
The above expressions aren’t overly powerful on their own, but when combined and added to a control’s OnClick event, makers can easily create their own GUIDs of varying length and complexity:
E.g., 32-character GUID.

As with any programming language, variables are used to store and later retrieve values. To assign this GUID to a variable in Power Fx, use the Set() expression. But to first generate the GUID, use the ForAll() and Sequence() expressions together to specify the GUID length. In this example, the GUID will have a length of 128 characters.
Within the ForAll() loop, randomize each entry with the RandBetween() expression and use a Swtich() to specify the character type options:
- If 0, then number.
- If 1, then uppercase letter.
- If 2, then lowercase letter.
Important to note, the letters are just randomized numbers of a set range. To convert these numbers into characters, use the Char() expression with their ASCII value as a parameter. Finally, the resulting loop values are appended into a string with no spaces using the Concat() expression:
Set(vGuid,
Concat(
ForAll(Sequence(128),
Switch(RandBetween(0, 2),
0, $"{ With(
{ tempValue: RandBetween(1, 10) },
Switch(tempValue,
10, "0",
$"{ tempValue }"
))
}", // Numbers
1, $"{ Char(RandBetween(65, 90)) }", // Uppercase
2, $"{ Char(RandBetween(97, 122)) }" // Lowercase
)
),
Value,""
)
)
Conclusion:
There are dozens of expressions available in Power Fx, but they can only do so much on their own. For creative solutions, they can be combined in creative ways…
“No.”
Rosa Parks
#BlackLivesMatter