Forum Discussion
JB_AT
1 year agoHelper III
Memory failure: While attempting to store a string, a string was found that was larger than the page
I hope you can help I am getting data from the active directory through the connector. I want to get the Thumbnail photo. For some photos I get the error above in the title. I think the String is...
- 1 year ago
The Power Query string length limit is 32K
https://blog.crossjoin.co.uk/2019/05/19/storing-large-images-in-power-bi-datasets/
ZhangKun
1 year agoSuper User
string length must less 32KB(32 * 1024 Byte). if the size of picture converted to base64 text is to larger, it should be split into small chunks.
following code domonstration load local image, convert to base64 and split to small chunk
(imagePath as text, optional splitLength as number) =>
let
limitLength = splitLength ?? 30 * 1024,
base64Text = Binary.ToText(File.Contents(imagePath)),
base64Length = Text.Length(base64Text),
result = List.Generate(
()=>0,
each _ * limitLength <= base64Length,
each _ + 1,
each [index = _, substring = Text.Middle(base64Text, _ * limitLength, limitLength)]
)
in
result