Adding Woocommerce Shipment Tracking Meta for Watch Orders -> Google Sheets

Hi I’m new to Make :slight_smile: Hopefully someone can help, I have a scenario where I am getting the woocommerce order data and passing it to a google sheet for a sales report. I can bring in the order info, however I am trying to also add in the shipping tracking number.

I am not sure how to map this in the google sheets module?

It is showing in the data collected by the WC module but after this I am am a bit stuck! Nay help would be much appreciated thank you!

image

You can use the built-in function map to extract the data you need.

For more assistance, please provide the following:

Please provide the output bundles of the modules by running the scenario, then click the white speech bubble on the top-right of each module and select “Download output bundles”.
Screenshot_2023-10-06_141025

A.

Save the bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

Uploading it here will look like this:

bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted output bundle in this manner:

  • Either add three backticks ``` before and after the code, like this:

    ```
    input/output bundle content goes here
    ```

  • Or use the format code button in the editor:
    Screenshot_2023-10-02_191027

Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

Your screenshots does not show the raw key names (only labels), so I am unable to assist until you provide the output bundles in text format.

Following these steps will allow others to assist you here. Thanks!

2 Likes

{{first(map(first(map(metaData; "value"; "key"; "_wc_shipment_tracking_items")); "trackingNumber"))}}

Screenshot_2024-02-14_170222

Output

Screenshot_2024-02-14_170234

You can copy and paste this module export into your scenario. This will paste the modules shown in my screenshots above.

  1. Copy the code below by clicking the copy button when you mouseover the top-right of the code block
    Screenshot_2024-01-17_200117

  2. Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV to paste in the canvas.

  3. Click on each imported module and save it. You may need to remap some variables.

Modules JSON Export

{
    "subflows": [
        {
            "flow": [
                {
                    "id": 47,
                    "module": "util:SetVariable2",
                    "version": 1,
                    "parameters": {},
                    "mapper": {
                        "name": "value",
                        "scope": "roundtrip",
                        "value": "{{first(map(first(map(46.metaData; \"value\"; \"key\"; \"_wc_shipment_tracking_items\")); \"trackingNumber\"))}}"
                    },
                    "metadata": {
                        "designer": {
                            "x": -1087,
                            "y": -802
                        },
                        "restore": {
                            "expect": {
                                "scope": {
                                    "label": "One cycle"
                                }
                            }
                        },
                        "expect": [
                            {
                                "name": "name",
                                "type": "text",
                                "label": "Variable name",
                                "required": true
                            },
                            {
                                "name": "scope",
                                "type": "select",
                                "label": "Variable lifetime",
                                "required": true,
                                "validate": {
                                    "enum": [
                                        "roundtrip",
                                        "execution"
                                    ]
                                }
                            },
                            {
                                "name": "value",
                                "type": "any",
                                "label": "Variable value"
                            }
                        ],
                        "interface": [
                            {
                                "name": "value",
                                "label": "value",
                                "type": "any"
                            }
                        ]
                    }
                }
            ]
        }
    ],
    "metadata": {
        "version": 1
    }
}
2 Likes

Hi Sam,

Amazing work! That was spot on thank you! I can now get the tracking number into Google sheets :pray:

No problem, glad I could help!

1. If you have a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.

2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.

This marks the topic as solved, so that:

  • others can save time when catching up with the latest activity here, and,
  • allows others to quickly jump to the solution if they come across the same problem

To do this, simply click the checkbox at the bottom of the post that answers your question:
Screenshot_2023-10-04_161049

3. Don’t forget to like and bookmark this topic so you can get back to it easily in future!