Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Unanswered

Complex Object as input parameter to PCF

(0) ShareShare
ReportReport
Posted on by 8

Hi 

Currently PCF input parameters allow only basic key value pair as input with standard data type.

Is there way I can accept complex object as input parameter? Certainly, I can pass JSON as input but that wont be a intuitive user experience. Is there designer experience for complex property?

thanks

-san

  • Community Power Platform Member Profile Picture
    on at
    Re: Complex Object as input parameter to PCF

    Hi,

    It's a long shot but, do you have any example for this solution I could use?

    Thanks

  • cchannon Profile Picture
    4,702 Super User 2025 Season 1 on at
    Re: Complex Object as input parameter to PCF

    OK, so not offering anything really new here, just restating what has already been posted in a way that more directly answers @sandeep_rp1 's question:

     

    Yes, you can come up with a more user-friendly solution, if you are ready to put in a bit of work. Because you can pass string variables of any content, you could, for example, pass an XML resource URL or a GUID for a CDS record; whatever you want to use to store your full config.

     

    To make it user-friendly, you might create a custom entity called "PCF Config" and add to it fields that represent the config you want folks to be able to control. So, your PCF loads, then the first thing it does is use the WebAPI (assuming you're deployed in a model-driven app) to call that record and retrieve its config.

     

    In fact, you could have the config be user-specific and never pass any string to the PCF; just query for the config record owned by the current user, then default to some set of params if they haven't set up any user preferences. That would make for a pretty good user experience. The caveat to that would be user counts. If your deployment has 40K users, the UI experience might be sluggish if it has to query and page through all those results, but if you only have a couple thousand users, it should be plenty quick enough as long as you <>.filter() the results and don't try to loop through them.

  • a33ik Profile Picture
    3,304 Most Valuable Professional on at
    Re: Complex Object as input parameter to PCF

    @ben-thompson @DianaBirkelbach actually it can be both - passing of configuration itself (if it's small considering the limitation of 100 symbols for string inputs) or reference to configuration webresource that could be retrieved from the code of PCF.

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at
    Re: Complex Object as input parameter to PCF

    Hi @ben-thompson ,

     

    I think @a33ik means string inputs for the name of a WebResource where a JSON can be placed.

     

    An alternative would be a string property with the name of an Environment Variable (but I think it's still in Preview).

     

    @sandeep_rp1 It depends what you need to configure in the JSON. For some cases it could work when you use a few properties with standard data type, instead of one property. The values doesn't have to be fields, it can be Enums or static values.

     

    Best regards,

    Diana

  • Ben Thompson Profile Picture
    1,400 on at
    Re: Complex Object as input parameter to PCF

    @a33ik Provided the serialized JSON object is less than 100 characters long as I don't think that issue has been fixed yet.

  • a33ik Profile Picture
    3,304 Most Valuable Professional on at
    Re: Complex Object as input parameter to PCF

    At the moment there is no way to pass anything more complex than whole number, string or something similar so... you will have to be creative. I believe that string input plus JSon can do whatever you need.

    Good luck.

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

Announcing the Engage with the Community forum!

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

🌸 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…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 87 Most Valuable Professional

#2
mmbr1606 Profile Picture

mmbr1606 71 Super User 2025 Season 1

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 67 Super User 2025 Season 1

Overall leaderboard