Help Changing the template to importe notes from Zotero

I have been trying to modify the template to import the annotations from zotero into my obsidian.
Although ive seen many templates in the web, i cannot modify it to do what I want.

I want a Header for each different color I used for highlighting information in the artice.
i.e {%- macro colorValueToName(color) -%}
{%- switch color -%}
{%- case “#ffff00” -%}
General / Introduction
{%- case “#ff7f7f” -%}
Needs
{%- case “#ffbf7f” -%}
Gaps or limitations
{%- case “#7fff7f” -%}
Methodology related
{%- case “#7fffff” -%}
Important results
{%- case “#ff7fff” -%}
Concepts or Definitions
{%- case “#bf7fbf” -%}
Definitions / concepts
{%- case “#bf7fbf” -%}
Study Area
{%- endswitch -%}
{%- endmacro -%}

And all i want is to import all the sentences i highlighted with yellow to be under the header “General”, all the ones with orange under the header "Needs"and so on and so on.

This is the code I have so far:

{%- macro colorValueToName(color) -%}
{%- switch color -%}
{%- case “#ffff00” -%}
General / Introduction
{%- case “#ff7f7f” -%}
Needs
{%- case “#ffbf7f” -%}
Gaps or limitations
{%- case “#7fff7f” -%}
Methodology related
{%- case “#7fffff” -%}
Important results
{%- case “#ff7fff” -%}
Concepts or Definitions
{%- case “#bf7fbf” -%}
Definitions / concepts
{%- case “#bf7fbf” -%}
Study Area
{%- endswitch -%}
{%- endmacro -%}

{% persist “annotations” %}
{% set annots = annotations | filterby(“date”, “dateafter”, lastImportDate) -%}
{% if annots.length > 0 %}

{% for color, annots in annots | groupby(“color”) -%}

{{colorValueToName(color)}}

{% for annot in annots -%}

[!{% if annot.color %}|{{annot.color}}{% endif %}]
{%- if annot.annotatedText %}
{{annot.annotatedText | nl2br}}
{%- endif -%}
{%- if annot.imageRelativePath %}
![[{{annot.imageRelativePath}}]]
{%- endif %}
{%- if annot.ocrText %}
{{annot.ocrText}}
{%- endif %}
{%- if annot.comment %}

{{annot.comment | nl2br}}
{%- endif %}

Page {{annot.page}}

{% endfor -%}
{% endfor -%}
{% endif %}
{% endpersist %}

but I still dont know how to change it to do what i want. This is a screenshot of what i see:

Please, if anyone can help me, im not the best with coding, so eveything is taking longer than expected.

Thank you!!

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