Embedding an image when using dataview rows?

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?

lib, (edited )

Hey, have you tried the following?

<pre style="background-color:#ffffff;">
<span style="color:#323232;">TABLE
</span><span style="color:#323232;">embed(link(rows.image, "250")) AS Image
</span><span style="color:#323232;">FROM "Journal/Entities/Devices"
</span><span style="color:#323232;">WHERE type
</span><span style="color:#323232;">SORT type DESC
</span>

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

dowath,
dowath avatar

YES. 🙏

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

lib,

Happy to help! Glad it worked out.

surrendertogravity,

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

  • All
  • Subscribed
  • Moderated
  • Favorites
  • obsidianmd@lemmy.world
  • DreamBathrooms
  • ngwrru68w68
  • tester
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • mdbf
  • tacticalgear
  • megavids
  • osvaldo12
  • normalnudes
  • cubers
  • cisconetworking
  • everett
  • GTA5RPClips
  • ethstaker
  • Leos
  • provamag3
  • anitta
  • modclub
  • JUstTest
  • lostlight
  • All magazines