craftcms / feed-me

Craft CMS plugin for importing entry data from XML, RSS or ATOM feeds—routine task or on-demand.
Other
288 stars 139 forks source link

Possible to add default field data to direct url? #1281

Open andykearney opened 1 year ago

andykearney commented 1 year ago

Is it possible to add a specific field default to the direct feed url?

Example:

XXXX-XXXX-XXXX.com/index.php/actions/feed-me/feeds/run-task?direct=1&feedId=XXX&passkey=XXXXXXXXX&fields[variant-locationStock]=0&offset=163&limit=6

Use case.

We built a custom inventory management system and manage approx 30k product variants from google sheets. I can generate direct feed urls for groups of variants on a google sheet for convenient updating of data with a single click, however I want to include specific defaults in the direct feed url depending on the data being updated, rather than having to potentially change the field mapping manually each time.

kristiansp commented 1 year ago

I’m not sure I 100% understand what you are trying to achieve, but I think the answer is no the way you describe it. But if I understand what you try to achieve, the easiest way is perhaps to hook onto Feed Me’s afterParseFeed event, and set the default values you would like:

https://docs.craftcms.com/feed-me/v4/developers/events.html#data-fetching-related-events

I’d be happy to help you out, if you describe what you want to achieve in a bit more detail.

(P.S. I guess this shouldn’t really be filed as a bug, maybe more a feature request, and perhaps belongs on the discussions page.)