Parsing notes with specific tag and key fields to create an array for Templater

What I want to do:

Get the contents of a specific inline datafield, e.g. Program:: from a specific set of notes, defined by e.g. #typeofnote

Those should then be added to an array were the key is equals the value, eg.
Program:: Obsidian


Then I would add Other:Other to the array and pass that to templater suggester function.

I wonder if plain javascript or dataviewjs would be the better option.

Any idea?

You could use a dataviewjs query on the tag, group by the field (e.g. program) and then map the resulting rows.key array to a new one that has your desired formatting and “Other” option.