Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to add property to node via Org-Roam Capture #2398

Open
boowebb opened this issue Nov 2, 2023 · 1 comment
Open

Trying to add property to node via Org-Roam Capture #2398

boowebb opened this issue Nov 2, 2023 · 1 comment

Comments

@boowebb
Copy link

boowebb commented Nov 2, 2023

Description

documentation states

  %^{prop}p   Prompt the user for a value for property `prop'.
              A default value can be specified like this:
              %^{prop|default}p.

I have tried adding %^{DISTANCE}p to the 'head' string (file+head :target type) and have tried adding to a template file. In both cases I get

Wrong type argument: stringp, nil

I have also tried to add :PROPERTIES: to my template file, but it creates two PROPERTIES blocks, the first before the head slug with ID and the 2nd after the head and before the template content.

Steps to Reproduce

  1. Find Node, enter name
  2. Choose custom template
  3. Fill in prompted info, up to property prompt

Backtrace

Expected Results

New node should be created with property inserted into properties block

Actual Results

  1. error is thrown
  2. OR two properties blocks are created

Environment

  • Emacs: GNU Emacs 29.1 (build 1, aarch64-apple-darwin21.6.0, NS appkit-2113.60 Version 12.6.6 (Build 21G646))
    of 2023-08-16
  • Framework: N/A
  • Org: Org mode version 9.7-pre (release_9.6.10-902-g41ff56 @ /Users/webbjd/.emacs.d/straight/build/org/)
  • Org-roam: v2.2.2-42-g5c06471
  • sqlite-connector: sqlite-builtin
@akashpal-21
Copy link

akashpal-21 commented Dec 25, 2023

I couldn't get it working by the method described in documentation too, however it is very easy to add a property using the capture system

(add-to-list 'org-roam-capture-templates
    '("t" "test template" plain
      "%?"
      :target (file+head "test.org"
                      ":PROPERTIES:\n:test: %^{Enter test value}\n:END:\n#+title: ${title}")
      :unnarrowed t)
   )

I have also tried to add :PROPERTIES: to my template file, but it creates two PROPERTIES blocks, the first before the head slug with ID and the 2nd after the head and before the template content.

This is because you are possibly adding the :Properties: after the title not before

Please try this template - we can even set a value without asking user input by removing the %^{Enter test value} part.

Best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants