Can someone check my code/flow?

I created a flow - I hope - and I was wondering if someone can tell me if I have my method correct and if the code I used is correct. I was going to ask how to test it, but I just found some Youtube videos I’m going to review on that. If you have a recommended video, I will take a link though.

The flow is this.

If I set this up correctly, it should check to see if the order is NOT = 3D shipping. Then it is supposed to send an email of the customer’s order off to a fulfillment center. If it DOES = 3D shipping, then it sends the order to the admin.

Here is what I have in the email. It’s the same for both notices, it’s just routing the emails differently:

A new order has been placed through {{shop.name}}

Please fulfill the following order:

Customer Information
Name: { {order.customer.first_name} } { {order.customer.last_name} } Email: { {order.customer.email} } Phone: { {order.customer.phone} }
Order Information

Order Number: #{ {order.id | split:'gid://shopify/Order/' | last}} Order Date: { {order.created_at} }

Billing Address
{ {order.billing_address.name} } { {order.billing_address.address1} } { {order.billing_address.address2} } { {order.billing_address.city} }, { {order.billing_address.province} } { {order.billing_address.zip} } { {order.billing_address.country} }

Shipping Address
{ {order.shipping_address.name} } { {order.shipping_address.address1} } { {order.shipping_address.address2} } { {order.shipping_address.city} }, { {order.shipping_address.province} } { {order.shipping_address.zip} } { {order.shipping_address.country} }

Order Items
Product	Quantity
{% for item in order.line_items %} | { {item.title} } | { {item.quantity} } | {% endfor %}

Thank you!

Send tracking and invoicing to: insert email here.

I’m new to this liquid stuff and obviously, shopify flow, so I’m wondering if someone can look at the code and see if I did this correctly or if there is a more efficient way to share this information with my fulfillment center. Obviously, they don’t need to know the prices. They have them. They just need the order ID, the customer information and the order details. Hopefully, I have all that properly.

Thanks in advance.

Not sure where you got the liquid you are using there but it’s definitely not correct. Flow uses fields from the GraphQL API and following the camelCasing syntax for all variables. Regarding your condition, we can’t tell much from the condition summary - you should share an image of that.

That said, this workflow doesn’t look very destructive so I would test against existing orders in the Admin. See how here: https://help.shopify.com/en/manual/shopify-flow/manage/manual

Doesn’t look Destructive?? I don’t know what that mean.

Well, the liquid I had Ai create it. Since I don’t know it. I’ve had it creating liquid coding for me for Shopify edits and I haven’t had an issue yet and everything has worked. Maybe I needed to know the GraphiQL API part.

Would this be more appropriate?

Hello,

A new order has been placed at { company.name }! Below are the details:

Customer Information
Name: { {order.customer.firstName} } { {order.customer.lastName} } Email: { {order.customer.email} } Phone: { {order.customer.phone} }

Order Information
Order Number: #{ {order.id | split:'gid://shopify/Order/' | last}} Order Date: { {order.createdAt} }

Billing Address
{ {order.billingAddress.name} } { {order.billingAddress.address1} } { {order.billingAddress.address2} } { {order.billingAddress.city} }, { {order.billingAddress.province} } { {order.billingAddress.zip} } { {order.billingAddress.country} }

Shipping Address
{ {order.shippingAddress.name} } { {order.shippingAddress.address1} } { {order.shippingAddress.address2} } { {order.shippingAddress.city} }, { {order.shippingAddress.province} } { {order.shippingAddress.zip} } { {order.shippingAddress.country} }

Order Items
Product	Quantity
{% for item in order.lineItems %} | { {item.title} } | { {item.quantity} } | {% endfor %}

Thank you!

I’m really just trying to create a flow that sends my customer orders to my fulfilment center for the orders that go to them otherwise just send them to me. Though, some people order items that ship from both profiles. Some items for me to fulfill and some for my vendor…so I’m thinking I need to add more to the condition?

Here is that condition

I used Ai to generate it since I don’t know liquid, however, I didn’t have the GraphQL API knowledge. So, I added that and generated new code. Here is what I have now. I think it’s correct now because I also received the same code when selecting it from the “Add Variables” section of your app.

Hello,

A new order has been placed at { company.name }! Below are the details:

Customer Information
Name: { {order.customer.firstName} } { {order.customer.lastName} } Email: { {order.customer.email} } Phone: { {order.customer.phone} }

Order Information
Order Number: #{ {order.id | split:'gid://shopify/Order/' | last}} Order Date: { {order.createdAt} }

Billing Address
{ {order.billingAddress.name} } 
{ {order.billingAddress.address1} } 
{ {order.billingAddress.address2} } 
{ {order.billingAddress.city} }, { {order.billingAddress.province} } { {order.billingAddress.zip} }

Shipping Address
{ {order.shippingAddress.name} } 
{ {order.shippingAddress.address1} } 
{ {order.shippingAddress.address2} } 
{ {order.shippingAddress.city} }, { {order.shippingAddress.province} } { {order.shippingAddress.zip} }

Order Items
Product	Quantity
{% for item in order.lineItems %} | { {item.title} } | { {item.quantity} } | {% endfor %}

Thank you!

Send tracking and invoicing to: insert email here.

All I want to do is capture customer orders, check to see if it’s supposed to go to me or to my vendor. I’m using the type of shipping to figure it out. If 3D shipping is the type of shipping attached to the order, then it will send the order to me any other shipping, send the customer order to my vendor.

I’m just worried that it will mess up if someone orders products that use BOTH shipping profiles. Here is the condition right now.