Copy of Snippet "New Snippet"

Forward and reverse lookup in keyed lists

{keyed_list=["alpha"="a","beta"="b"]}
{reverse_lookup=[keyed_list[x]=x for x in keys(keyed_list)]}

Original list is {=keyed_list}
Reversed lookup list is {=reverse_lookup}

{search_query="a"}
{if: includes(keys(keyed_list), search_query)}
List match {=search_query} is {=keyed_list[search_query]}
{else}
Reverse list match {=search_query} is {=reverse_lookup[search_query]}
{endif}