Different markdown value based on data from sql query

Could someone point me in right direction how to manipulate text in markdown component based on value that i am getting in data ? I have created it as

filters

| essql query="SELECT 'dobry' AS "mojstatus""

| markdown

content={

string value = "{{rows.0.mojstatus}} "

value=" xx "

value=" aaa"

value = " zzz"

value = " xyz"

}

| render
I can display the 'dobry' value of my query in the markdown with string concatenation, now i would just need to change some other values based on the value of 'mojstatus', if it is equal to 'dobry' then next value should be xx, but if its 'zly' , then yy , for example
I am now stuck with how to apply compare or / if , i have been searching reading a lot, but still have not found the answer. I saw articles that use the mapColumn, but i don't even understand if i have to use this approach. I really would appreciate any pointers.

//edit
I managed to get the displaying part, but i dont understand why the image is not displayed correctly when it hits the 'false' scenario. it just prints the base64 string and thats it, no image is loaded. the id is correct.

filters

| essql query="SELECT 'zly' AS "mojstatus""

| markdown

content={

string value = "{{rows.0.mojstatus}} "

value=" xx "

value=" aaa"

value = " zzz"

value = " xyz"

value = {string "![My Image](" {if condition={getCell "mojstatus" | eq 'zly'} then={asset "asset-ae3daa35-22f8-4062-a7af-4190b679c9cf"} else={asset "asset-1759c798-20b2-455e-af7f-53f1016cbcc8"} } ")"}

}

| render

//edit
looks like the second asset was corrupted from my side. I would still love to get some pointers if this cane be done better/if i am doing anything wrong,.

Thank you

You are on the right track.
Here you find some examples https://elastic-content-share.eu/downloads/apm-services-overview-canvas/

If you like to add an image to markdown you need to add a Link.

Thank you Felix!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.