[{"data":1,"prerenderedAt":413},["ShallowReactive",2],{"\u002Fblog\u002Fhow-to-check-whether-an-inline-fields-contains-a-value-with-obsidian-dataview":3,"\u002Fblog\u002Fhow-to-check-whether-an-inline-fields-contains-a-value-with-obsidian-dataview-neighbours":380},{"id":4,"title":5,"body":6,"date":366,"description":367,"draft":368,"draftReasons":369,"extension":37,"meta":370,"navigation":56,"path":374,"private":368,"seo":375,"sitemap":376,"stem":377,"tags":378,"updatedAt":369,"__hash__":379},"blog\u002Fblog\u002Fhow-to-check-whether-an-inline-fields-contains-a-value-with-obsidian-dataview.md","How to Check Whether an Inline Fields Contains a Value with Obsidian Dataview",{"type":7,"value":8,"toc":358},"minimark",[9,13,18,29,32,95,100,107,129,132,159,163,166,169,215,222,225,229,236,239,257,260,274,283,286,304,307,315,318,335,338,342,354],[10,11,12],"p",{},"One of my favorite Obsidian plugins is Obsidian Dataview. It's brilliant at letting me create custom dashboards. However, I recently came across a problem where I struggled to query notes with inline fields properly. And after searching high and low in the forums and docs, I figured out a solution and wanted to share it here.",[14,15,17],"h2",{"id":16},"the-problem","The Problem",[10,19,20,21,28],{},"When creating a dashboard, I love leveraging the ",[22,23,27],"a",{"href":24,"rel":25},"https:\u002F\u002Fblacksmithgu.github.io\u002Fobsidian-dataview\u002Fannotation\u002Fadd-metadata\u002F",[26],"nofollow","inline fields"," to create custom metadata properties that can be queried. It gives a kind of database schema feel as a result.",[10,30,31],{},"For example, let's take a blog post note:",[33,34,39],"pre",{"className":35,"code":36,"language":37,"meta":38,"style":38},"language-md shiki shiki-themes github-dark-high-contrast","# Obsidian After 3 Years of Use\n\nStill lovin' my time with Obsidian.\n\nType:: #type\u002Fblog-post\nTopics:: [[Obsidian]]\nStatus:: #status\u002Fdraft\n","md","",[40,41,42,51,58,65,70,76,89],"code",{"__ignoreMap":38},[43,44,47],"span",{"class":45,"line":46},"line",1,[43,48,50],{"class":49},"s-VM4","# Obsidian After 3 Years of Use\n",[43,52,54],{"class":45,"line":53},2,[43,55,57],{"emptyLinePlaceholder":56},true,"\n",[43,59,61],{"class":45,"line":60},3,[43,62,64],{"class":63},"sMAXC","Still lovin' my time with Obsidian.\n",[43,66,68],{"class":45,"line":67},4,[43,69,57],{"emptyLinePlaceholder":56},[43,71,73],{"class":45,"line":72},5,[43,74,75],{"class":63},"Type:: #type\u002Fblog-post\n",[43,77,79,82,86],{"class":45,"line":78},6,[43,80,81],{"class":63},"Topics:: [[",[43,83,85],{"class":84},"sTRMh","Obsidian",[43,87,88],{"class":63},"]]\n",[43,90,92],{"class":45,"line":91},7,[43,93,94],{"class":63},"Status:: #status\u002Fdraft\n",[96,97,99],"h3",{"id":98},"creating-a-dataview-query-to-check-whether-an-inline-field-equates-to-a-value","Creating a dataview query to check whether an inline field equates to a value",[10,101,102,103,106],{},"If I wanted to build a custom dataview to see all blog posts that have the topic of ",[40,104,105],{},"[[Obsidian]]",", here is how I might have built a custom dataview:",[33,108,112],{"className":109,"code":110,"language":111,"meta":38,"style":38},"language-dataview-example shiki shiki-themes github-dark-high-contrast","TABLE status, topics\nFROM #type\u002Fblog-post\nWHERE topics = [[@Obsidian]]\n","dataview-example",[40,113,114,119,124],{"__ignoreMap":38},[43,115,116],{"class":45,"line":46},[43,117,118],{},"TABLE status, topics\n",[43,120,121],{"class":45,"line":53},[43,122,123],{},"FROM #type\u002Fblog-post\n",[43,125,126],{"class":45,"line":60},[43,127,128],{},"WHERE topics = [[@Obsidian]]\n",[10,130,131],{},"To break down each line, the query:",[133,134,135,147,153],"ol",{},[136,137,138,139,142,143,146],"li",{},"Builds a table that displays the ",[40,140,141],{},"status"," and ",[40,144,145],{},"topics"," inline fields as individual columns",[136,148,149,150],{},"Pulls in all notes that are tagged with ",[40,151,152],{},"#type\u002Fblog-post",[136,154,155,156,158],{},"Checks to see if the ",[40,157,145],{}," inline field value is equivalent to [[@Obsidian|Obsidian]]",[96,160,162],{"id":161},"but-wait-what-if-the-field-contains-other-values-thats-not-relevant","But wait, what if the field contains other values that's not relevant...",[10,164,165],{},"While this works for the example we've setup, there eventually comes a point where you might have a blog post that requires more than one topic that's not a complete match to the original query.",[10,167,168],{},"For example, here is a blog post where I might talk about Obsidian and Notion:",[33,170,172],{"className":35,"code":171,"language":37,"meta":38,"style":38},"# Obsidian vs Notion: The Showdown\n\nAs someone who could be considered a Notion power user, here's how my experience between the two has been.\n\nType:: #type\u002Fblog-post\nTopics:: [[@Obsidian]], [[Notion]]\nStatus:: #status\u002Fdraft\n",[40,173,174,179,183,188,192,196,211],{"__ignoreMap":38},[43,175,176],{"class":45,"line":46},[43,177,178],{"class":49},"# Obsidian vs Notion: The Showdown\n",[43,180,181],{"class":45,"line":53},[43,182,57],{"emptyLinePlaceholder":56},[43,184,185],{"class":45,"line":60},[43,186,187],{"class":63},"As someone who could be considered a Notion power user, here's how my experience between the two has been.\n",[43,189,190],{"class":45,"line":67},[43,191,57],{"emptyLinePlaceholder":56},[43,193,194],{"class":45,"line":72},[43,195,75],{"class":63},[43,197,198,200,203,206,209],{"class":45,"line":78},[43,199,81],{"class":63},[43,201,202],{"class":84},"@Obsidian",[43,204,205],{"class":63},"]], [[",[43,207,208],{"class":84},"Notion",[43,210,88],{"class":63},[43,212,213],{"class":45,"line":91},[43,214,94],{"class":63},[10,216,217,218,221],{},"Unfortunately, in this scenario, our ",[40,219,220],{},"Obsidian vs Notion: The Showdown"," post won't be included in the our query from above.",[10,223,224],{},"So, what do we do from here?",[14,226,228],{"id":227},"the-solution","The Solution",[10,230,231,232,235],{},"The silver bullet that we're looking for is the ",[40,233,234],{},"contains"," method.",[10,237,238],{},"Here's what it looks like in practice:",[33,240,242],{"className":109,"code":241,"language":111,"meta":38,"style":38},"TABLE status, topics\nFROM #type\u002Fblog-post\nWHERE contains(topics, [[@Obsidian]])\n",[40,243,244,248,252],{"__ignoreMap":38},[43,245,246],{"class":45,"line":46},[43,247,118],{},[43,249,250],{"class":45,"line":53},[43,251,123],{},[43,253,254],{"class":45,"line":60},[43,255,256],{},"WHERE contains(topics, [[@Obsidian]])\n",[10,258,259],{},"While the syntax isn't the most intuitive at first glance, here's how I would break it down.",[133,261,262,271],{},[136,263,264,266,267,270],{},[40,265,234],{}," is a helper method (like using ",[40,268,269],{},"SUM"," in an Excel spreadsheet) that Dataview provides us",[136,272,273],{},"It takes two parameters which are comma separated and wrapped with parentheses",[275,276,277],"ul",{},[136,278,279,280],{},"Example: ",[40,281,282],{},"contains(DATA_SOURCE, DESIRED_VALUE)",[10,284,285],{},"Now that you know the syntax, think of the method as:",[287,288,289],"blockquote",{},[10,290,291,292,295,296,295,299,295,301],{},"Get notes ",[40,293,294],{},"WHERE"," ",[40,297,298],{},"DATA_SOURCE",[40,300,234],{},[40,302,303],{},"DESIRED_VALUE",[10,305,306],{},"In other words, to solve our problem, we want to check if an inline field contains the desired value we want. Taking our example from above:",[33,308,313],{"className":309,"code":311,"language":312},[310],"language-text","WHERE contains(topics, [[@Obsidian]])`\n","text",[40,314,311],{"__ignoreMap":38},[10,316,317],{},"It results in the semantic translation of our query to:",[287,319,320],{},[10,321,322,323,325,326,328,329,325,331,334],{},"Grab notes ",[40,324,294],{}," the ",[40,327,145],{}," inline field ",[40,330,234],{},[40,332,333],{},"[[@Obsidian]]"," note.",[10,336,337],{},"And that's all there is to it!",[14,339,341],{"id":340},"next-steps","Next Steps",[10,343,344,345,347,348,353],{},"If you'd like to learn more about how ",[40,346,234],{}," works, check out the ",[22,349,352],{"href":350,"rel":351},"https:\u002F\u002Fblacksmithgu.github.io\u002Fobsidian-dataview\u002Freference\u002Ffunctions\u002F#contains-and-friends",[26],"the official docs",".",[355,356,357],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .s-VM4, html code.shiki .s-VM4{--shiki-default:#91CBFF;--shiki-default-font-weight:bold}html pre.shiki code .sMAXC, html code.shiki .sMAXC{--shiki-default:#F0F3F6}html pre.shiki code .sTRMh, html code.shiki .sTRMh{--shiki-default:#ADDCFF}",{"title":38,"searchDepth":53,"depth":53,"links":359},[360,364,365],{"id":16,"depth":53,"text":17,"children":361},[362,363],{"id":98,"depth":60,"text":99},{"id":161,"depth":60,"text":162},{"id":227,"depth":53,"text":228},{"id":340,"depth":53,"text":341},"2023-08-09T20:11:23-04:00","Recently, I came across a problem where I struggled to query notes with inline fields properly. And after searching high and low in the forums and docs, I figured out a solution and wanted to share it here.",false,null,{"stage":371,"planted":366,"tended":366,"topics":372},"evergreen",[373],"obsidian","\u002Fblog\u002Fhow-to-check-whether-an-inline-fields-contains-a-value-with-obsidian-dataview",{"title":5,"description":367},{"loc":374,"lastmod":366},"blog\u002Fhow-to-check-whether-an-inline-fields-contains-a-value-with-obsidian-dataview",[373],"FJqLMYUKy-925hI0TEbGQYfpUQDje4GvFCJ5kuZk6Sw",{"newer":381,"older":388,"related":396},{"title":382,"path":383,"tags":384,"date":387},"Embracing the Boring Solution","\u002Fblog\u002Fembracing-the-boring-solution",[385,386],"journal","development","2023-11-01T18:53:10-04:00",{"title":389,"path":390,"tags":391,"date":395},"My Favorite Underrated Vue 3 Feature","\u002Fblog\u002Fmy-favorite-underrated-vue-3-feature",[392,393,394],"vue","css","javascript","2023-08-08T20:32:39-04:00",[397,402,408],{"title":398,"path":399,"tags":400,"date":401},"Get Started with Obsidian in 5 Minutes","\u002Fblog\u002Fget-started-with-obsidian-in-5-minutes",[373],"2025-12-01T23:25:27-05:00",{"title":403,"path":404,"tags":405,"date":407},"How I Use Obsidian to Better Understand How I Operate (Sep 2024)","\u002Fblog\u002Fhow-i-use-obsidian-to-better-understand-how-i-operate-sep-2024",[373,406],"productivity","2024-09-05T12:23:04-04:00",{"title":409,"path":410,"tags":411,"date":412},"How to Use Minimal Night Owl Theme in Obsidian","\u002Fblog\u002Fhow-to-use-minimal-night-owl-theme-in-obsidian",[373,393],"2024-01-17T20:58:56-05:00",1795896354608]