Shopify split Items

I am a newbie. I want to export data from specific shopify items that are ordered. I believe this would use Split Fulfilled Line Items after the order paid trigger for shopify. I want to ensure that if the same product is in the order multiple times, the data will be uplled for each instance.

Hi @mai3, welcome to the community :tada:

Unfortunately, I don’t have a suitable Shopify account ready for testing. Can you confirm how the data structure you are getting from your Shopify trigger looks like? (feel free to redact anything confidential, I am of course just interested in the data structure and not your actual product names or customer data.)

Does it already include the information you need (all line items)?

If not, perhaps you can use a regular Shopify node fetching the order details after your trigger node to get all line items?

Hi @MutedJam Here is a test order. You can see that the product ID 8106472407317 appears twice each with first name, last name, and gender. I want to be able to plit/extract those fields/parameters for individual use, and have the process run for each instance. Here is the JSON from the trigger.

[
{
“id”: 5352280686869,
“admin_graphql_api_id”: “gid://shopify/Order/5352280686869”,
“app_id”: 580111,
“browser_ip”: “5.22.135.195”,
“buyer_accepts_marketing”: true,
“cancel_reason”: null,
“cancelled_at”: null,
“cart_token”: “1cade5ec18c6b90abd238c453d0a8e6c”,
“checkout_id”: 36721181917461,
“checkout_token”: “06edf944e9fb3f7db13b21f92fba6182”,
“client_details”: {
“accept_language”: “en-US”,
“browser_height”: null,
“browser_ip”: “5.22.135.195”,
“browser_width”: null,
“session_hash”: null,
“user_agent”: “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36”
},
“closed_at”: null,
“confirmed”: true,
“contact_email”: “[email protected]”,
“created_at”: “2023-06-07T02:30:24-04:00”,
“currency”: “USD”,
“current_subtotal_price”: “0.00”,
“current_subtotal_price_set”: {
“shop_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
}
},
“current_total_additional_fees_set”: null,
“current_total_discounts”: “59.90”,
“current_total_discounts_set”: {
“shop_money”: {
“amount”: “59.90”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “59.90”,
“currency_code”: “USD”
}
},
“current_total_duties_set”: null,
“current_total_price”: “0.00”,
“current_total_price_set”: {
“shop_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
}
},
“current_total_tax”: “0.00”,
“current_total_tax_set”: {
“shop_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
}
},
“customer_locale”: “en-CH”,
“device_id”: null,
“discount_codes”: [
{
“code”: “testmord”,
“amount”: “59.90”,
“type”: “percentage”
}
],
“email”: “[email protected]”,
“estimated_taxes”: false,
“financial_status”: “paid”,
“fulfillment_status”: null,
“landing_site”: “/products/hebrew-name-certificate”,
“landing_site_ref”: null,
“location_id”: null,
“merchant_of_record_app_id”: null,
“name”: “2941-shopify”,
“note”: null,
“note_attributes”: [],
“number”: 1941,
“order_number”: 2941,
“order_status_url”: “Thank you! - Israel365 - Checkout”,
“original_total_additional_fees_set”: null,
“original_total_duties_set”: null,
“payment_gateway_names”: [],
“phone”: null,
“presentment_currency”: “USD”,
“processed_at”: “2023-06-07T02:30:22-04:00”,
“reference”: “42cf278566eb3ebbb4f5fdab7236dd3c”,
“referring_site”: “”,
“source_identifier”: “42cf278566eb3ebbb4f5fdab7236dd3c”,
“source_name”: “web”,
“source_url”: null,
“subtotal_price”: “0.00”,
“subtotal_price_set”: {
“shop_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
}
},
“tags”: “”,
“tax_lines”: [],
“taxes_included”: false,
“test”: false,
“token”: “798fb538b2190936e4f52a79a4370d30”,
“total_discounts”: “59.90”,
“total_discounts_set”: {
“shop_money”: {
“amount”: “59.90”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “59.90”,
“currency_code”: “USD”
}
},
“total_line_items_price”: “59.90”,
“total_line_items_price_set”: {
“shop_money”: {
“amount”: “59.90”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “59.90”,
“currency_code”: “USD”
}
},
“total_outstanding”: “0.00”,
“total_price”: “0.00”,
“total_price_set”: {
“shop_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
}
},
“total_shipping_price_set”: {
“shop_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
}
},
“total_tax”: “0.00”,
“total_tax_set”: {
“shop_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
}
},
“total_tip_received”: “0.00”,
“total_weight”: 0,
“updated_at”: “2023-06-07T02:30:24-04:00”,
“user_id”: null,
“billing_address”: {
“first_name”: “a”,
“address1”: “222 East 41st Street”,
“phone”: “(212) 568-4466”,
“city”: “New York”,
“zip”: “10017”,
“province”: “New York”,
“country”: “United States”,
“last_name”: “a”,
“address2”: null,
“company”: null,
“latitude”: 40.7493378,
“longitude”: -73.97407369999999,
“name”: “a a”,
“country_code”: “US”,
“province_code”: “NY”
},
“customer”: {
“id”: 6752130695445,
“email”: “[email protected]”,
“accepts_marketing”: true,
“created_at”: “2023-01-23T04:25:48-05:00”,
“updated_at”: “2023-06-07T02:30:24-04:00”,
“first_name”: “mordecai”,
“last_name”: “altose”,
“state”: “disabled”,
“note”: null,
“verified_email”: true,
“multipass_identifier”: null,
“tax_exempt”: false,
“phone”: “+972509329552”,
“email_marketing_consent”: {
“state”: “subscribed”,
“opt_in_level”: “single_opt_in”,
“consent_updated_at”: “2023-03-02T08:18:51-05:00”
},
“sms_marketing_consent”: {
“state”: “not_subscribed”,
“opt_in_level”: “single_opt_in”,
“consent_updated_at”: null,
“consent_collected_from”: “SHOPIFY”
},
“tags”: “”,
“currency”: “USD”,
“accepts_marketing_updated_at”: “2023-03-02T08:18:51-05:00”,
“marketing_opt_in_level”: “single_opt_in”,
“tax_exemptions”: [],
“admin_graphql_api_id”: “gid://shopify/Customer/6752130695445”,
“default_address”: {
“id”: 9207091265813,
“customer_id”: 6752130695445,
“first_name”: “a”,
“last_name”: “a”,
“company”: null,
“address1”: “222 East 41st Street”,
“address2”: null,
“city”: “New York”,
“province”: “New York”,
“country”: “United States”,
“zip”: “10017”,
“phone”: “(212) 568-4466”,
“name”: “a a”,
“province_code”: “NY”,
“country_code”: “US”,
“country_name”: “United States”,
“default”: true
}
},
“discount_applications”: [
{
“target_type”: “line_item”,
“type”: “discount_code”,
“value”: “100.0”,
“value_type”: “percentage”,
“allocation_method”: “across”,
“target_selection”: “all”,
“code”: “testmord”
}
],
“fulfillments”: [],
“line_items”: [
{
“id”: 13917834051861,
“admin_graphql_api_id”: “gid://shopify/LineItem/13917834051861”,
“fulfillable_quantity”: 1,
“fulfillment_service”: “manual”,
“fulfillment_status”: null,
“gift_card”: false,
“grams”: 0,
“name”: “Hebrew Name Certificate - Digital”,
“price”: “29.95”,
“price_set”: {
“shop_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
}
},
“product_exists”: true,
“product_id”: 8106472407317,
“properties”: [
{
“name”: “First Name”,
“value”: “joanna”
},
{
“name”: “Last Name”,
“value”: “smith”
},
{
“name”: “Gender”,
“value”: “Female”
}
],
“quantity”: 1,
“requires_shipping”: false,
“sku”: “HNC_Digital”,
“taxable”: true,
“title”: “Hebrew Name Certificate - Digital”,
“total_discount”: “0.00”,
“total_discount_set”: {
“shop_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
}
},
“variant_id”: 44295156728085,
“variant_inventory_management”: null,
“variant_title”: null,
“vendor”: “Israel365”,
“tax_lines”: [
{
“channel_liable”: false,
“price”: “0.00”,
“price_set”: {
“shop_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
}
},
“rate”: 0.04,
“title”: “New York State Tax”
},
{
“channel_liable”: false,
“price”: “0.00”,
“price_set”: {
“shop_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
}
},
“rate”: 0.00375,
“title”: “New York County Tax”
},
{
“channel_liable”: false,
“price”: “0.00”,
“price_set”: {
“shop_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
}
},
“rate”: 0.045,
“title”: “Manhattan City Tax”
}
],
“duties”: [],
“discount_allocations”: [
{
“amount”: “29.95”,
“amount_set”: {
“shop_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
}
},
“discount_application_index”: 0
}
]
},
{
“id”: 13917834084629,
“admin_graphql_api_id”: “gid://shopify/LineItem/13917834084629”,
“fulfillable_quantity”: 1,
“fulfillment_service”: “manual”,
“fulfillment_status”: null,
“gift_card”: false,
“grams”: 0,
“name”: “Hebrew Name Certificate - Digital”,
“price”: “29.95”,
“price_set”: {
“shop_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
}
},
“product_exists”: true,
“product_id”: 8106472407317,
“properties”: [
{
“name”: “First Name”,
“value”: “steve”
},
{
“name”: “Last Name”,
“value”: “smith”
},
{
“name”: “Gender”,
“value”: “Male”
}
],
“quantity”: 1,
“requires_shipping”: false,
“sku”: “HNC_Digital”,
“taxable”: true,
“title”: “Hebrew Name Certificate - Digital”,
“total_discount”: “0.00”,
“total_discount_set”: {
“shop_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
}
},
“variant_id”: 44295156728085,
“variant_inventory_management”: null,
“variant_title”: null,
“vendor”: “Israel365”,
“tax_lines”: [
{
“channel_liable”: false,
“price”: “0.00”,
“price_set”: {
“shop_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
}
},
“rate”: 0.04,
“title”: “New York State Tax”
},
{
“channel_liable”: false,
“price”: “0.00”,
“price_set”: {
“shop_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
}
},
“rate”: 0.00375,
“title”: “New York County Tax”
},
{
“channel_liable”: false,
“price”: “0.00”,
“price_set”: {
“shop_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
}
},
“rate”: 0.045,
“title”: “Manhattan City Tax”
}
],
“duties”: [],
“discount_allocations”: [
{
“amount”: “29.95”,
“amount_set”: {
“shop_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
}
},
“discount_application_index”: 0
}
]
}
],
“payment_terms”: null,
“refunds”: [],
“shipping_address”: null,
“shipping_lines”: []
}
]

Thank you for sharing this example payload @mai3!

You can see that the product ID 8106472407317 appears twice each with first name, last name, and gender. I want to be able to plit/extract those fields/parameters for individual use, and have the process run for each instance.

This will actually be simpler than I originally expected based on your sample data :slight_smile:

In a first step, you can use the Item Lists node to split out the line_items field. In the second step you can then use the Set node to format the data as required. Extracting Product ID, First name, Last name, gender for example could look like so (assuming the order of properties for each line item doesn’t change):

In a workflow, this looks like so:

Hope this helps!

1 Like

Hi, in order to set this, it seems like I need live data, not just test data. I activated the workflow and placed a Shopify order, but don’t see it listed in the executions. What am I missing? Also the example in the workflow above seems to only be a spinning circle of dots. Once I have that in I will want to perform specific actions with specific products. Thank you!

Also the example in the workflow above seems to only be a spinning circle of dots

Hi @mai3, you mean here on the forum you are seeing only dots rather than the actual workflow as shown below?

Are you (or your IT department if you’re on a company network) by any chance blocking some of the website content here on the forum? Which browser are you using?

I activated the workflow and placed a Shopify order, but don’t see it listed in the executions

Are you storing successful executions in the first place? You might need to enable this in either the workflow settings or globally (via n8n.cloud if using n8n cloud, or by setting the EXECUTIONS_DATA_SAVE_ON_SUCCESS=all environment variable when self-hosting).

1 Like

Hi, thanks for the explanation. I can now see the graphic.
I have a run here, but it did not split the products as far as I can tell. What do I need to change?
THanks

Hi @mai3, the “Field To Split Out” field would require a field name, not a field value like in your example. Make sure to only use the field name (like line_items), and no surrounding curly brackets like {{ or }}.

1 Like

Great! I got it!:
For the next step, I’d like to us the data shown in product 13925594792213 to look up some data in a Google sheet, and paste the results of the lookup in another google sheets. What are the next steps?

I will also want to do something similar with other products.

Here is the output from the item split.
[
{
“id”: 13925594759445,
“admin_graphql_api_id”: “gid://shopify/LineItem/13925594759445”,
“fulfillable_quantity”: 1,
“fulfillment_service”: “manual”,
“fulfillment_status”: null,
“gift_card”: false,
“grams”: 0,
“name”: “Hebrew Birthday Certificate - Digital”,
“price”: “29.95”,
“price_set”: {
“shop_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
}
},
“product_exists”: true,
“product_id”: 8106472374549,
“properties”: [
{
“name”: “First Name”,
“value”: “rose”
},
{
“name”: “Last Name”,
“value”: “stanley”
},
{
“name”: “Birthdate”,
“value”: “1995-03-05”
}
],
“quantity”: 1,
“requires_shipping”: false,
“sku”: “HBC_Digital”,
“taxable”: true,
“title”: “Hebrew Birthday Certificate - Digital”,
“total_discount”: “0.00”,
“total_discount_set”: {
“shop_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
}
},
“variant_id”: 44295156695317,
“variant_inventory_management”: null,
“variant_title”: null,
“vendor”: “Israel365”,
“tax_lines”: [],
“duties”: [],
“discount_allocations”: [
{
“amount”: “29.95”,
“amount_set”: {
“shop_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
}
},
“discount_application_index”: 0
}
]
},
{
“id”: 13925594792213,
“admin_graphql_api_id”: “gid://shopify/LineItem/13925594792213”,
“fulfillable_quantity”: 1,
“fulfillment_service”: “manual”,
“fulfillment_status”: null,
“gift_card”: false,
“grams”: 0,
“name”: “Hebrew Birthday Certificate - Digital”,
“price”: “29.95”,
“price_set”: {
“shop_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
}
},
“product_exists”: true,
“product_id”: 8106472374549,
“properties”: [
{
“name”: “First Name”,
“value”: “joel”
},
{
“name”: “Last Name”,
“value”: “stanley”
},
{
“name”: “Birthdate”,
“value”: “1995-06-01”
}
],
“quantity”: 1,
“requires_shipping”: false,
“sku”: “HBC_Digital”,
“taxable”: true,
“title”: “Hebrew Birthday Certificate - Digital”,
“total_discount”: “0.00”,
“total_discount_set”: {
“shop_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
}
},
“variant_id”: 44295156695317,
“variant_inventory_management”: null,
“variant_title”: null,
“vendor”: “Israel365”,
“tax_lines”: [],
“duties”: [],
“discount_allocations”: [
{
“amount”: “29.95”,
“amount_set”: {
“shop_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
}
},
“discount_application_index”: 0
}
]
},
{
“id”: 13925594824981,
“admin_graphql_api_id”: “gid://shopify/LineItem/13925594824981”,
“fulfillable_quantity”: 1,
“fulfillment_service”: “manual”,
“fulfillment_status”: null,
“gift_card”: false,
“grams”: 0,
“name”: “Hebrew Name Certificate - Digital”,
“price”: “29.95”,
“price_set”: {
“shop_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
}
},
“product_exists”: true,
“product_id”: 8106472407317,
“properties”: [
{
“name”: “First Name”,
“value”: “jane”
},
{
“name”: “Last Name”,
“value”: “smith”
},
{
“name”: “Gender”,
“value”: “Female”
}
],
“quantity”: 1,
“requires_shipping”: false,
“sku”: “HNC_Digital”,
“taxable”: true,
“title”: “Hebrew Name Certificate - Digital”,
“total_discount”: “0.00”,
“total_discount_set”: {
“shop_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
}
},
“variant_id”: 44295156728085,
“variant_inventory_management”: null,
“variant_title”: null,
“vendor”: “Israel365”,
“tax_lines”: [],
“duties”: [],
“discount_allocations”: [
{
“amount”: “29.95”,
“amount_set”: {
“shop_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
}
},
“discount_application_index”: 0
}
]
},
{
“id”: 13925594857749,
“admin_graphql_api_id”: “gid://shopify/LineItem/13925594857749”,
“fulfillable_quantity”: 1,
“fulfillment_service”: “manual”,
“fulfillment_status”: null,
“gift_card”: false,
“grams”: 0,
“name”: “Hebrew Name Certificate - Digital”,
“price”: “29.95”,
“price_set”: {
“shop_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
}
},
“product_exists”: true,
“product_id”: 8106472407317,
“properties”: [
{
“name”: “First Name”,
“value”: “joe”
},
{
“name”: “Last Name”,
“value”: “smith”
},
{
“name”: “Gender”,
“value”: “Male”
}
],
“quantity”: 1,
“requires_shipping”: false,
“sku”: “HNC_Digital”,
“taxable”: true,
“title”: “Hebrew Name Certificate - Digital”,
“total_discount”: “0.00”,
“total_discount_set”: {
“shop_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “0.00”,
“currency_code”: “USD”
}
},
“variant_id”: 44295156728085,
“variant_inventory_management”: null,
“variant_title”: null,
“vendor”: “Israel365”,
“tax_lines”: [],
“duties”: [],
“discount_allocations”: [
{
“amount”: “29.95”,
“amount_set”: {
“shop_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
},
“presentment_money”: {
“amount”: “29.95”,
“currency_code”: “USD”
}
},
“discount_application_index”: 0
}
]
}
]

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.