not passing multiple custom fields
See original GitHub issueSeems to only pass the last custom field passed to customFields.
ie:
let parser = new Parser({
customFields: {
item: ['s:type','s:type'],
item: ['s:vendor','s:vendor']
item: ['summary','summary'],
//item: ['s:tag','s:tag'],
//item: ['s:variant','s:variant', {keepArray: true}] //<---
}
});
parser.parseURL('https://kith.com/collections/all/products.atom', function(err, feed) {
//console.log(feed.extendedDescription);
if(!err){
feed.items.forEach(function(entry) {
//console.log(entry['s:type']);
//console.log(entry['s:vendor']);
console.log(entry.summary);
//console.log(entry['s:tag']);
//console.log(entry['s:variant']);
//console.log(entry);
});
//console.log(feed.items[7]['s:type']);
//console.log(feed.items[7]['s:vendor']);
console.log(feed.items[7]['summary']);
//console.log(feed.items[7]['s:tag']);
//console.log(feed.items[5]['s:variant']['s:price'][0]['_']);
//console.log(feed.items[5].summary);
}else{
console.log(err.message);
};
Seems to only pass THE LAST item added to “customFields”. ‘s:vendor’ will show undefined untill “item: [‘summary’,‘summary’],” is commented out then it will work.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Multiple Custom Fields - Anuko Forums
I would like to have more than one custom field available. I started using a custom field in order to add a different...
Read more >How to pass multiple custom fields as shortcode's parameters
And here is the code I built to call shortcode with parameters, but I only know pass 1 custom fields at one time....
Read more >Cannot create multiple custom fields using Metadata API
Hi all,. I can successfully connect to the Metadata API and create a custom field, but what I would like to do is...
Read more >How to pass multiple values to custom fields using campaign ...
You need to create "Custom fields"(on right sidebar) from your listid. Ex(Subject,Phone Number,Suburb,Message etc). When you export the ...
Read more >Setting multiple values in multi_enum custom fields
I'm attempting to create tasks via the /tasks endpoint and want to set multiple values in a custom multi_enum field.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You syntax isn’t quite right:
And since you’re not trying to rename fields, it can be even simpler:
(Also note that your input above, which has multiple
item
fields, isn’t really a valid JS object - in JS, you can only specify one value per key).