Getting/mapping product variations from woocommerce and sending to sheets

I’m having trouble grabbing data from meta data arrays to output into a column in google sheets. I’ve read pretty much every article related to this, but I’m still stumped.

I can see the data in the woocommerce module under line items>collection 1>metadata>collections 1 2 and 3…

But I can’t see these same collections in the google sheets module…

So I need to map them, right? Like I said, I’ve been reading articles in here explaining similar things, and I use the get and map functions as outlined in some topics…
getmap arrays

but this isn’t working.

I’m not sure what I’m doing wrong. Any help would be greatly appreciated.

Hi @Casey_Griswold,

Welcome to the Make community!

You are mapping the {{Line Items []: Meta Data}} array to get a value, where the id is 489. But this ID field does not exist in this array. Do you see where this might go wrong?

You are one array too deep. Try to map the {{Line items[]}} array and use dot notation to access the value. So map array with value {{Meta Data.value}}, where ID is 489. Something like this:

get(map({{Line Items[]}};{{Meta Data.value}};ID;489);1)

Use the raw names of the arrays.

Please, follow these steps when asking a question, and you’ll be more likely to get a helpful answer:

:writing_hand: Give us a detailed explanation of what you’re trying to achieve

:footprints: Tell us about any steps you’ve tried so far

:camera_flash: Include screenshots of:

  • your scenario flow and setup (functions, mappings, variables, etc.)

  • module configurations and outputs

  • any error messages you are getting

:card_file_box: Share the blueprint of the scenario you are asking a question about. (this does not contain any connection or personal information)

Henk
Certified Make Expert and Partner
Book a consult with me

3 Likes

I’ll give it a shot. I appreciate the response.

Can I recommend some viewing of my Make for Make Newbies video series here in the community? I think it will help you greatly when dealing with data structures. It starts out really easy and covers a ton of the sort of work you’ll be doing when extracting values out of arrays and collections. All you have to do is watch the video and I provide you the scenarios you can use to follow along and practice.

3 Likes

I started watching it. It’s helpful. I’m still a little stuck though. Do I need JSON in my scenario?? Because I’m not sure how to integrate JSON. My current scenario is only using woocommerce and google sheets. I thought for a while I needed an iterator between them, but I couldn’t figure that out either. So far your videos are working with JSON and you don’t cover that. Maybe you do later.

I’m pretty sure I have a complex array, now it’s just a matter of figuring out how to tell it which array and sub array and key values.

Ok, looks like video 3 might show me. It better show me, Alex. If it doesn’t teach me, my computer is going off a bridge. :rofl: I’m just kidding.

1 Like

Oh don’t do that. Just try to be patient. I use parse json to simulate the data you may get from another module. You definitely don’t need to use it unless you want to experiment generating similar structures that are generated by other app modules.

In the end it’s all json going into and out of each module, every single time.

1 Like

Hi @Casey_Griswold

This post can be a game changer while dealing with Arrays in Make.

If you require additional assistance, please don’t hesitate to reach out to us.
MSquare Support | Book Live Implementation
Visit us here
Youtube Channel

1 Like

Ahh, that makes sense

I figured it out. Thanks for everyone’s help.

3 Likes