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
Hi,
It's a long shot but, do you have any example for this solution I could use?
Thanks
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.
@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.
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
@a33ik Provided the serialized JSON object is less than 100 characters long as I don't think that issue has been fixed yet.
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.
WarrenBelz
87
Most Valuable Professional
mmbr1606
71
Super User 2025 Season 1
Michael E. Gernaey
67
Super User 2025 Season 1