Hi everyone,
I’m a beginner with Make — it’s actually my first day using it, and I’ve already spent a lot of time trying to solve this issue. I’m having trouble extracting a specific value from an array of Meta Data
Each product on my website has a custom URL stored in the ‘_product_url` meta field’
Here’s what I’m trying to do:
- I have an array of Meta Data, each object has a
Key
and a Value
.
- I want to extract the
Value
where Key
equals _product_url
- My goal is to get the URL as a simple string.
I want to get the URL for a specific product in order to include it in an Instagram post,
I tried the following formula, but I keep getting errors (“filterfalse is not a valid array”, “Unclosed function”, etc.) :
Failed to map ‘value’: Function ‘get’ finished with error! Function ‘map’ finished with error! ‘selectrank_math_internal_links_processed’ is not a valid array.
I don’t find the correct formula. PLease help
Thanks
Loïc
1 Like
You can use this in the set a variable module.
map( {{arrayOfMetaData}} ; {{value}} ; {{key}} ; product_url )
This returns {{value}}
If you don’t understand, send a screenshot of the metadata.
You mean something like this ? It gives me an error:
Failed to map ‘value’: Function ‘map’ finished with error! ‘rank_math_internal_links_processed’ is not a valid array.
I don’t know why it’s trying to use the meta key rank_math_internal_links_processed instead of _product_url, which does exist in my database.
You have to do the mapping yourself. I just showed you how you’re supposed to structure your map() function.
Map( 1st item ; 2nd item ; 3rd item ; 4th item )
Here’s what I mean, In the map function, from the data in the aggregator,
- The first item in my formula is the array, select the product array from the aggregator.
- The second item in my formula is the value, you expand the array and select the value you want to extract.
- The third item in my formula is the key, you select the key.
- Then you type the value of that key
as the last item.
Hi,
I’m trying to understand your message, do you mean :
map( 31. Array[] : Meta Data[] : Key ; "_product_url" )
.
The problem is that this formula doesn’t work.
Should work if well formatted
it doesn’t work. I give up
hi @Loic_Guillout
try {{get(map(31.metaData; “value”; “key”; “_wpb_post_custom_layout”); 1)}}
regards