πŸš€ Automating Microsoft List User Creation in Power Apps with UDFs and UDTs

I’ve been exploring the powerful new features in Power Apps:
βœ… User-Defined Types (UDTs)
βœ… User-Defined Functions (UDFs)

To test them out, I built a clean and reusable function that generates user records for a Microsoft List using Office 365 data.

πŸ‘‡ Here’s a simplified version of what I did:

ty_UserRecord := Type({
  '@odata.type': Text,
  Claims: Text,
  Department: Text,
  DisplayName: Text,
  Email: Text,
  JobTitle: Text,
  Picture: Text
});

UF_AutoGenerateUserRecord(Mail: Text): ty_UserRecord = {
  '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
  Claims: "i:0#.f|membership|" & Mail,
  Department: Office365Users.UserProfile(Mail).Department,
  DisplayName: Office365Users.UserProfile(Mail).DisplayName,
  Email: Office365Users.UserProfile(Mail).Mail,
  JobTitle: Office365Users.UserProfile(Mail).JobTitle,
  Picture: Office365Users.UserPhotoV2(Mail)
};

πŸ“Œ This small abstraction allowed me to:

  • Standardize user structure across the app 🧩
  • Encapsulate logic for easier reuse πŸ”„
  • Improve readability and reduce errors πŸ“‰

If you’re building scalable Power Apps, UDFs and UDTs are a game-changer.
Happy to share more if you’re curious!

Leave A Comment

Your email address will not be published. Required fields are marked *