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