# How to capture to org daily under a specific heading

**URL:** <https://org-roam.discourse.group/t/how-to-capture-to-org-daily-under-a-specific-heading/2892>\
**Category:** How To\
**Created:** [December 15, 2022, 6:27pm UTC](https://org-roam.discourse.group/t/how-to-capture-to-org-daily-under-a-specific-heading/2892 "2022-12-15T18:27:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![troam](https://avatars.discourse-cdn.com/v4/letter/t/cc9497/32.png) [@troam](https://org-roam.discourse.group/u/troam)\
**Post date:** [December 15, 2022, 6:27pm UTC](https://org-roam.discourse.group/t/how-to-capture-to-org-daily-under-a-specific-heading/2892/1 "2022-12-15T18:27:07Z")

</div>

Hello,

I was following this article to create daily journal entries, and they shared this capture template:

```auto
(setq org-roam-dailies-capture-templates
      '(("d" "default" entry "* %<%I:%M %p>: %?"
         :if-new (file+head "%<%Y-%m-%d>.org" "#+title: %<%Y-%m-%d>\n"))))

```

How can I modify this so that the timestamped entry would be placed under a heading in the daily org file.

For example:

```auto
* Notes
** 10:00 AM: Figured out how to capture entries under the "Notes" heading!

```

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [December 16, 2022, 6:47am UTC](https://org-roam.discourse.group/t/how-to-capture-to-org-daily-under-a-specific-heading/2892/2 "2022-12-16T06:47:07Z")

</div>

I believe [this](https://org-roam.discourse.group/t/need-help-with-org-roam-dailies-capture-template/2882/4) might help; you’d need to tweak it a little.

---

<div class="post-metadata">

**Author:** ![troam](https://avatars.discourse-cdn.com/v4/letter/t/cc9497/32.png) [@troam](https://org-roam.discourse.group/u/troam)\
**Post date:** [December 18, 2022, 5:22am UTC](https://org-roam.discourse.group/t/how-to-capture-to-org-daily-under-a-specific-heading/2892/3 "2022-12-18T05:22:37Z")

</div>

Thanks! That worked!

Writing this here in case it helps others: I couldn’t find any documentation in the manual for the `file+head+olp` or even `file+head` target type. It turns out that the description for these is in the `org-roam-capture-templates` variable docstring.

---

<div class="post-metadata">

**Author:** ![shahensha](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@shahensha](https://org-roam.discourse.group/u/shahensha)\
**Post date:** [October 26, 2023, 5:15am UTC](https://org-roam.discourse.group/t/how-to-capture-to-org-daily-under-a-specific-heading/2892/4 "2023-10-26T05:15:55Z")

</div>

@troam Can you please share your final code?

@nobiot Is it possible to take the heading under which I want to add the subheading as an input from the user rather than hardcoding it to a particular value?

---

<div class="post-metadata">

**Author:** ![troam](https://avatars.discourse-cdn.com/v4/letter/t/cc9497/32.png) [@troam](https://org-roam.discourse.group/u/troam)\
**Post date:** [October 27, 2023, 5:30pm UTC](https://org-roam.discourse.group/t/how-to-capture-to-org-daily-under-a-specific-heading/2892/5 "2023-10-27T17:30:44Z")

</div>

Here’s what I’m using:

```auto
(setq org-roam-dailies-capture-templates
      '(
        ("l" "Daily Log Entry" entry "** %<%I:%M %p>: %?"
         :target (file+head+olp "%<%Y-%m-%d>.org"
                                "#+title: %<%Y-%m-%d>\n\n* Log\n:PROPERTIES:\n:VISIBILITY: children\n:END:\n"
                                ("Log"))
         :unnarrowed t)

        ))

```

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [October 29, 2023, 9:14am UTC](https://org-roam.discourse.group/t/how-to-capture-to-org-daily-under-a-specific-heading/2892/6 "2023-10-29T09:14:09Z")

</div>

Based on @troam, you can replace `"Log"` with `"%^{prompt}"` according to the documentation string of `org-roam-capture-templates`, like this below.

It works on my end. You can change the “Type node” in the way you want.

```plaintext
(setq org-roam-dailies-capture-templates
      '(("l" "Daily Log Entry" entry "** %<%I:%M %p>: %?"
         :target (file+head+olp "%<%Y-%m-%d>.org"
                                "#+title: %<%Y-%m-%d>\n\n* Log\n:PROPERTIES:\n:VISIBILITY: children\n:END:\n"
                                ("%^{Type node}"))
         :unnarrowed t)))

```

---

<div class="post-metadata">

**Author:** ![shahensha](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@shahensha](https://org-roam.discourse.group/u/shahensha)\
**Post date:** [November 30, 2023, 11:30pm UTC](https://org-roam.discourse.group/t/how-to-capture-to-org-daily-under-a-specific-heading/2892/7 "2023-11-30T23:30:34Z")

</div>

@troam @nobiot Thank you so much for being helpful. This works for me. Although, I realized that I have to type in the exact heading or else it creates a new one instead of failing). Is there a way to rather let me choose from the existing headlines in the file? Or fail instead of creating a new one, thereby making sure no unnecessary headlines are created.

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [December 2, 2023, 5:35am UTC](https://org-roam.discourse.group/t/how-to-capture-to-org-daily-under-a-specific-heading/2892/8 "2023-12-02T05:35:51Z")

</div>

> [@shahensha](#):
>
> Is there a way to rather let me choose from the existing headlines in the file? Or fail instead of creating a new one, thereby making sure no unnecessary headlines are created

I think that you’d need to code your own thing if you really need a solution exactly as you describe.

If you have a few headlines for this capture and know what they are beforehand, you can list them in the capture template and select one when you capture a new note.

If interested, I suggest you to refer to [this part of documentation string](https://github.com/org-roam/org-roam/blob/main/org-roam-capture.el#L241-L243) of org-roam-capture-templates:
