Have your say in Community Polls: What was/is your greatest motivation to start your own business?

FLOW to retrieve file url from a custom field

FLOW to retrieve file url from a custom field

FernandoYB
Shopify Partner
3 0 0

Hi, beautiful community.


I try to retrieve the URL of a file uploaded into an order.
In particular, through the back office, before fulfilling an order it's possible to add a PDF to the order.
When the order is fulfilled a Flow trigger starts and I would like to send an email to the customer with the URL (link) of the document.
I use this code to retrieve the custom field (type File) that contains the file:

 

{% for metafields_item in order.metafields %}
  {% for references_item in metafields_item.references %}
    Certificazione : {{references_item.GenericFile.url}}
{% endfor %}
{% endfor %}
Copy

 


But the result is the GID of the file: 

gid://shopify/GenericFile/3682400822916


Any ideas?

 

Thanks, 

 

Fernando

Reply 1 (1)

paul_n
Shopify Staff
1431 157 332

I already answered this question elsewhere. You cannot access the "GenericFile" like that yet in Flow. 

 

You might be able to loop over the "fields" list in the reference to find the key and value for that field. I'm not sure what that will return in this use case without additional testing. 

 

We do have a project underway to improve how you access metafields in Flow, which will make use cases like this much easier.

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.