cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MarrinerDev
Advocate II
Advocate II

Record parameters to Component Custom property

I am building a Custom Component to contain a number of "Pure Functions" as described in Greg Lindhorst's blog:

https://powerapps.microsoft.com/en-us/blog/enhanced-component-properties/

Basically the component acts as a script library for a set of utility functions used throughout the app.

 

My experience is that it not possible to pass Records as parameters to these enhanced custom properties (even though it allows you to select "Record" from the type dropdown) because there is no way to refer to the individual values in the record itself. e.g. if the import record parameter was "Employee", then using dot notation Employee.LastName will not work and neither will table notation Employee[@LastName]. I believe this is due to the fact that the record definition isn't available to the component and that PowerApps' late-binding mechanism isn't able to resolve this at runtime.

 

Correct? Or am I doing something wrong?

 

Note that passing Employee as an input parameter to the component itself is not an option (even if this did work) as the component is a code library and not always used for Employees. etc

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @MarrinerDev ,

 

At my knowledge, If you want to pass a record to the component, you need to build a record with the same structure.

In other words, the component needs to get the column name.

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

2 REPLIES 2
v-xiaochen-msft
Community Support
Community Support

Hi @MarrinerDev ,

 

At my knowledge, If you want to pass a record to the component, you need to build a record with the same structure.

In other words, the component needs to get the column name.

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

MarrinerDev
Advocate II
Advocate II

I have found a comment from Greg in the comments section saying that "You define the shape with the default value for the parameter".  - A fact which doesn't appear in the docs. This highlights how appalling the developer documentation for PowerApps is. In terms of thoroughness and cross-referencing, even the old MSDN documentation for Win32 API's in the late 1990's had a quality which puts this cr*p to shame. Rant over.

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (1,803)