this post was submitted on 12 Jul 2023
10 points (100.0% liked)

ObsidianMD

3765 readers
3 users here now

Unofficial Lemmy community for https://obsidian.md

founded 1 year ago
MODERATORS
 

Hi all,

Discovered that I could embed images into dataview and have been changing up a bunch of my index pages excitedly.

It works great with my gear list:

> [!tip] Gear list
> ```dataview
> TABLE
>regexreplace(file.folder, ".*\/([^\/]+)$", "$1") AS "Department",
> shows AS "Shows",
>embed(link(image, "125")) AS Image
> FROM "Knowledgebase/Video Production/On-Set/Equipment"
> sort file.mday desc
> ```

At the top of each 'Equipment' note I have the variables:

category:: Lighting
shows:: [[Show Name 1]],[[Show Name 2]]
image:: [[MoonLite by LumenRadio-1689061964287.jpeg]]

That works entirely as expected - I get a snazzy list of images down the dataview for each item.

However, it doesn't work in this dataview, which is slightly different in the sense that it groups by 'type' - but even without the group-by clause it doesn't work:

> [!Example] Devices
> ```dataview
> TABLE
> rows.file.link AS "Title",
> embed(link(rows.file.image, "250")) AS Image
> FROM "Journal/Entities/Devices"
> WHERE type
> GROUP BY type
> SORT type DESC
> ```

With these notes having these variables:

type:: Server
image:: [[Pasted image 20221026215500.png]]

I thought 'rows.file.image' is how I'd access the image this time around, but unfortunately not.

This works, but not when I try to group them and bring in information using rows.file.

> [!Example] Devices
> ```dataview
> TABLE
> embed(link(image, "250")) AS Image
> FROM "Journal/Entities/Devices"
> WHERE type
> SORT type DESC
> ```

Any thoughts?

top 4 comments
sorted by: hot top controversial new old
[โ€“] [email protected] 5 points 1 year ago* (last edited 1 year ago) (1 children)

Hey, have you tried the following?

TABLE
embed(link(rows.image, "250")) AS Image
FROM "Journal/Entities/Devices"
WHERE type
SORT type DESC

Placing rows. in front of image should fix the problem.

[โ€“] [email protected] 3 points 1 year ago (1 children)

YES. ๐Ÿ™

That works, can't believe I didn't think of that. Thanks!!

[โ€“] [email protected] 2 points 1 year ago

Happy to help! Glad it worked out.

[โ€“] [email protected] 1 points 1 year ago

Any chance you could put together a mini-example vault to help troubleshoot on?

load more comments
view more: next โ€บ