Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I want to store some values as an array in the capabilitis.json object, The initial value will be null, as based on user interaction I'm updating property value using persistProperties.
Currently, I declare object type as text, and store array values by converting them to comma-separated values (eg; "val1, val2, val3"). But is there any better way to store array value in settings?
Solved! Go to Solution.
Hi @Anonymous,
There's no support for complex types as property values. Most developers will use text as the data type (as you're already doing), hide the property during enumeration and JSON.stringify the array before it's persisted. Use JSON.parse when you read it back.
You may be better with the property default as "[]" so that an 'empty' property will parse to an empty array and be ready to work with in your code (or you could coalesce a default null property value to an empty array).
Regards,
Daniel
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Hi @dm-p,
Thanks for the solution, I also tried diffrent approaches but ended up using the way you suggested.
Hi @Anonymous,
There's no support for complex types as property values. Most developers will use text as the data type (as you're already doing), hide the property during enumeration and JSON.stringify the array before it's persisted. Use JSON.parse when you read it back.
You may be better with the property default as "[]" so that an 'empty' property will parse to an empty array and be ready to work with in your code (or you could coalesce a default null property value to an empty array).
Regards,
Daniel
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
8 | |
7 | |
2 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
4 |