Searching for captured values
Once an order has been created with a custom field, it is possible to search for that order in the admin by a specific field value.
For example, a coffee shop can create a custom field with the key "Grind" that stores the type of grind customers want for their coffee. When it comes time to process orders, they might want to search for all orders where the Grind was captured as "Beans".
ShopFields stores custom values as an order attributes which aren't searchable in the admin. So to make field values searchable they will need to also be added as tags using Shopify Flow. This is a sample Shopify Flow that applies the "IMEI" custom field value to the order as a tag.
The last action is where we loop over our custom attributes looking for our key. If we find it, we apply that keys value. To use this in your own workspace, you can change "IMEI" to the key that you are working with (ie "Grind").
{% assign custom_attribute_key = "IMEI" %}
{% for customAttributes_item in order.customAttributes %}
{% if customAttributes_item.key == custom_attribute_key %}
{{customAttributes_item.value}}
{% endif %}
{% endfor %}
Caution
When working with tags it is important to remember that they can potentially be viewed by customers. So sensitive information is best put in metafields.