Hello, I am displaying SVGs in a gallery. To manage these SVGs centrally, I have defined them as variables in App OnStart.
Example of one SVG:
Set(HomeSVG, "<svg viewBox='0 0 2048 2048' xmlns='http://www.w3.org/2000/svg'><path d='M1024 165l941 942-90 90-83-82v805h-640v-640H896v640H256v-805l-83 82-90-90 941-942zm640 1627V987l-640-640-640 640v805h384v-640h512v640h384z' fill='#000000'></path></svg>")
To show this SVG in an image control, I use the following code. This works perfect.
"data:image/svg+xml;utf8, "&EncodeUrl(HomeSVG)
I have now put together several SVGs in a collection.
ClearCollect(CollectionSVG,
{
Label: "Home",
ImageSVG: HomeSVG
},
{
Label: "Main",
ImageSVG: MainSVG
},
{
Label: "Chart",
ImageSVG: ChartSVG
}
)
Now I want to use a gallery to show this collection. Data source of the gallery is "CollectionSVG". For the image control of the gallery I use the following code:
"data:image/svg+xml;utf8, "&EncodeUrl(ThisItem.ImageSVG)
The label text is shown correctly. The image control is empty (no error). If I change the code of the image control to ...
"data:image/svg+xml;utf8, "&EncodeUrl(HomeSVG)... all image controls of the gallery show the HomeSVG.
Why does "ThisItem.ImageSVG" does not work. Where is my error?
Thanks for your help.
Best regards,
Michael

Report
All responses (
Answers (