Skip to content

Instantly share code, notes, and snippets.

@brennandunn
Created May 20, 2020 03:06
Show Gist options
  • Save brennandunn/c95e1fa8e8b7a766892ee118fa1689cc to your computer and use it in GitHub Desktop.
Save brennandunn/c95e1fa8e8b7a766892ee118fa1689cc to your computer and use it in GitHub Desktop.
{% capture tuples %}
{{ subscriber.field_a }},field_a|
{{ subscriber.field_b }},field_b|
{{ subscriber.field_c }},field_c|
{{ subscriber.field_d }},field_d
{% endcapture %}
{% assign sorted_tuples = tuples | split: "|" | sort | reverse %}
{% for tuple in sorted_tuples %}
{% assign tuple_array = tuple | split: "," %}
{{ tuple_array[1] }}: {{ tuple_array[0] }}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment