Replies: 1 comment 3 replies
-
Hi, there's no API to put a note into a relation map. That step is manual. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Test Case:
My goal is: I want to create notes with template person programmatically (script) and integrate them in a “Family Tree”. Therefore I created a test case which adds a child note to a active person note.
Expected result:
The new note is created, labeled, linked and shown in the “Family Tree” map.
Implemented code:
Comments:
For my test case I reused the “button” example from Task manager implementation. I added first fetching the current note as source note, checking its label to be “person” and after entering backend, creating the new note inside the “My Family Tree” (labeled PeopleRoot) and setting a relation of person template. After this preparation ther are a few relations set: source note hasChild, new note isChildOf source note and a label person to new note. Finally results are returned, synced, notes opened for convenience.
Prerequisites:
"appVersion": "0.54.2", OS: Linux
My Family Tree:
#child:person #PeopleRoot #mapType=tree
person template:
#label:dateOfBirth=promoted,date,single #label:dateOfDeath=promoted,date,single #relation:isPartnerOf="promoted,inverse=isPartnerOf,multi" #relation:isChildOf="promoted,inverse=hasChild,multi" #relation:hasChild="promoted,inverse=isChildOf,multi" #person #iconClass="bx bx-face" #personTemplate
Result:
The new note TestPerson is created and labeled successfully: It is placed under “My Family Tree”.
New note TestPerson:
#person ~template=Person template ~isChildOf=Princess Diana #dateOfBirth=2022-08-14
Source note Princess Diana:
#dateOfBirth=1961-07-01 #dateOfDeath=1997-08-31 ~isPartnerOf=Prince Charles #person ~template=Person template ~hasChild=TestPerson
Missing Part:
The “My Family Tree” view doesn't show the new note. Nor can I find it elsewhere, however it is shown in the note map, backlinks etc as expected.
I looked up the docs, sources, read the discussions. What did I miss or what went wrong? How can I create a note as being a member of relation map? How can a relation relationMapLink be created? Please help, I am scratching my head. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions