web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Experimental Features
Unanswered

Declare User Defined Data Types for Powerapps Canvas

(2) ShareShare
ReportReport
Posted on by 8
Hi,
 
I saw in the latest update that powerapps supports custom data types to be used in UDFs. Can you help describe how to declare them
 
I have the same question (0)
  • adithyaselv Profile Picture
    Microsoft Employee on at
    Declare User Defined Data Types for Powerapps Canvas
    Hi,

    You can declare a user-defined time in the Formulas property similar to UDF and then use it in UDF . Please find a simple example below.

    -----
     
    //Record type
    Point := Type({x: Number, y: Number});
     
    // UDF to compute distance between two points
    distance(a:Point,b:Point):Number = Sqrt(Power(b.x - a.x, 2) + Power(b.y-a.y, 2));
     
    //Table type
    Points := Type([Point]);
     
    // UDF to check if the given table of points contains a particular point
    containsPoint(points: Points, target:Point): Boolean = CountIf(points, ThisRecord.x = target.x && ThisRecord.y = target.y) > 0;

    ----

    notice that you need to use := to declare user-defined type. Type is a special function used to construct a type definition.
  • Suggested answer
    adithyaselv Profile Picture
    Microsoft Employee on at
    Declare User Defined Data Types for Powerapps Canvas
    Hi,

    You can declare a user-defined time in the Formulas property similar to UDF and then use it in UDF . Please find a simple example below.

    -----
     
    //Record type
    Point := Type({x: Number, y: Number});
     
    // UDF to compute distance between two points
    distance(a:Point,b:Point):Number = Sqrt(Power(b.x - a.x, 2) + Power(b.y-a.y, 2));
     
    //Table type
    Points := Type([Point]);
     
    // UDF to check if the given table of points contains a particular point
    containsPoint(points: Points, target:Point): Boolean = CountIf(points, ThisRecord.x = target.x && ThisRecord.y = target.y) > 0;

    ----

    notice that you need to use := to declare user-defined type. Type is a special function used to construct a type definition.
  • IAmIntractable Profile Picture
    278 on at
    Declare User Defined Data Types for Powerapps Canvas
    I don't believe this is a general release feature yet.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Coming soon: forum hierarchy changes

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 803 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 314 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 253 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics