Drop down lists in tables and pulling information from tables into dataview/dataviewjs query

What I’m trying to do

I’m trying to organize data for a non-profit I volunteer with. Easy data collection and aggregation can them get funding and educate the public. This non-profit is focused on wildlife rehabilitation and we have daily notes about the animals in our care.

The current process is for volunteers to write their notes in a Google doc. I’ve copied that information and am just trying to make it easier to query it. As the current notes are just in a paragraph format, that was easy to generate a dataview table that shows the link to the day that note came from. Here is an example of what I currently have.

Current Dataview query:

TABLE
L.text + " " AS Notes
FROM [[]] 
FLATTEN file.lists AS L
WHERE contains(L.outlinks, [[]])

Table Example that generates from code above:

File Notes
[[link to daily note]] [[link to that animal’s page]] Notes for that animal on that particular day.

While easy, this leads to a long list of just paragraphs of text where a lot of information can be mixed up. So, I am testing whether putting all this information in a table would be better.

So, I have a table that looks like this rn:

Bird Code :boom:Significant Event :wastebasket:Food Removed :poop: :plate_with_cutlery: Fed :pill:Meds :bubbles:Cleanliness :left_speech_bubble:Comments
[[Animal 1]] :pickup_truck::farmer: Barn Transport 0 0 Food Fluids :broom:+:sponge:
[[Animal 2]] :sparkles:New Admit 1/2 1 HF NA :soap::house: Cleaned and moved
[[Animal 3]] :face_with_head_bandage: Reinjured All 2 None :soap::heavy_division_sign: Cleaned with divider

Now, my questions:

  1. Is there a way I can generate this to have drop-down menus? This table example exists in Google docs and I really like the drop-down menu options on there
  2. Is there a way to generate a query that would pull information from this table but only from a particular row? So, that way, when I go to the note for Animal 1, I only see the information pertaining to that animal.

Things I have tried

I’ve looked a plugins like Metadata Menu or Metadata Bind but they add information to the metadata of the note and as there are multiple animals per daily note, that doesn’t seem like that will work.

I’ve tried generating both dataview and dataviewjs queries that try to pull information from tables but it seems like it can’t find the information as I’m just getting null values.

Example:

// DataviewJS query to filter for the specific bird code
const birdCode = '[Aminal 1]';

// Retrieve the relevant rows from the dataview
let rows = dv.pages()
    .where(p => p["Bird Code"] === birdCode) // Filter for the specific bird code
    .map(p => [ // Map each page to an array for the table
        p["Bird Code"],
        p["Significant Event"],
        p["🗑️Food Removed"],
        p["💩"],
        p["🍽️ Fed"],
        p["💊Meds"],
        p["🫧Cleanliness"],
        p["🗨️Comments"]
    ]);

// Check if rows is empty and provide feedback
if (rows.length === 0) {
    dv.paragraph("No results found for the specified bird code.");
} else {
    // Create the table with the filtered rows
    dv.table(
        ["Bird Code", "Significant Event", "🗑️Food Removed", "💩", "🍽️ Fed", "💊Meds", "🫧Cleanliness", "🗨️Comments"],
        rows
    );
}

Any help would be greatly appreciated and this would help an amazing non-profit!

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