Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Experimental Features
Unanswered

User defined types in Custom Pages

(0) ShareShare
ReportReport
Posted on by
I am currently testing this cool new feature. As far as I can see it seems to be not fully implemented for Custom Pages. For example type declaration using the := operator result in an error. 
 
MyType := Type({Items: [{Id: Number}]});

Using the Type() function with ParseJSON directly works quite well. Yet I am having trouble deserializing arrays of primitive types. Here's my example:

Set(TestArray, ParseJSON("{ ""Ids"": [1,2,3] }", Type({Ids: [Number]})));
 
This throws the following error: "JSON parsing error, expected 'object' but got 'number'."
 
Seems like my type declaration isn't correct even though it is accepted in the code window. Arrays of complex types work well though:
 
Set(TestArray, ParseJSON("{ ""Items"": [{""Id"": 1},{""Id"":2},{""Id"":3}] }", Type({Items: [{Id: Number}]})));
 
Is there anything I can do about the primitive typed array and will this feature be available for production anytime soon?
  • Suggested answer
    CarlosFigueira Profile Picture
    on at
    User defined types in Custom Pages
    Currently, arrays of primitive values (or of other arrays) are not supported in the typed version of the ParseJSON function - only arrays of objects (like you showed in your second example) is supported at this point.
     
    As far as support for that, there are plans to support arrays of things other than objects, but we don't have any timeline at this point.
     
    Please consider creating a feature request at https://aka.ms/powerapps-ideas to add the support for that. The more upvotes it gets, the easier it is to increase its priority compared to other features we have.

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1

Featured topics