Skip to main content

Notifications

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

Like (2) ShareShare
ReportReport
Posted on 1 Nov 2024 18:42:33 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
 
  • IAmIntractable Profile Picture
    258 on 08 Jan 2025 at 20:44:48
    Declare User Defined Data Types for Powerapps Canvas
    I don't believe this is a general release feature yet.
  • Suggested answer
    adithyaselv Profile Picture
    Microsoft Employee on 04 Jan 2025 at 23:19:17
    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.
  • adithyaselv Profile Picture
    Microsoft Employee on 04 Jan 2025 at 23:08:58
    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.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Power Apps Experimental Features

#1
mmbr1606 Profile Picture

mmbr1606 33 Super User 2025 Season 1

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 18

#3
stanmiller95 Profile Picture

stanmiller95 16

Overall leaderboard

Featured topics

Loading started