Closed svondervoort closed 3 months ago
I did some more testing, and looks like it is looking for a specific element/entry ID to match with. So the value i'm sending obviously doesn't match since it doesn't check for title
and/or id
.
So I imagine you might have the ID for an entry in your Single-Line Text field, correct? That might be 2024
which you would like to match an entry element in an Entries field.
That should be possible, but there is a bug with that. Fixed for the next release. To get this early, run composer require verbb/formie:"dev-craft-4 as 2.1.19"
.
However, I see the error shows Invalid numeric value: 2024\/2025
- what are you actually entering in the Single-Line Text field in Formie?
title
(in this case 2024/2025
) for a non-existing Entry in the mapped Entry section which gave me the error.id
of an entry in the mapped Entry section which did work.title
of an entry in the mapped Entry section which did not work and gave the same error.So as I understand it works on a existing ID, but it does not work on a Title of an existing Entry. I'm not sure if its possible, but it would be great if the mapped field would also create an entry if it does not exist already. And also for it to be matched on title instead of just an ID.
Gotcha, so yep the value of the entries field will need to be the ID, either a single ID or a collection of them.
I know this was built into Feed Me a while ago (being able to pick what to match on), but that's not something that's built into Formie's mapping at the moment. It's probably something we'll get to one day, but it's quite a complication at the moment, and a whole new UI we'd need to implement (which is on the roadmap, but a way off yet).
Similarly, Formie won't create the element for an element field. It's also probably not something we're planning on supporting due to its overcomplexities. For example:
I'd say the best place for all this logic would be in an event - and that's probably not going to change anytime soon. It's absolutely possible to achieve what you want with the beforeSendPayload or afterSendPayload events.
I totally understand. Would be great to have it in a future version sometimes. Thanks for taking the time. In our case we can just create the entry in advance and prefill the field with the correct ID.
FeedMe actually can create an entry if the matching "type" is title
instead of an ID
since title is a required field within the entry. I guess FeedMe knows in which section the entry has to be created since the field has certain sections checked (see screenshot).
Indeed, in Feed Me you select the section and type and the data you are providing (ID, slug, title, etc). We'd have to introduce a similar UI in Formie to handle that. (FYI, I wrote Feed Me, and am aware of this sort of setup and that it can get complicated quickly!)
Describe the bug
I'm trying to map a
text input
to anentry field
in anelement integration - entry
but I get the error:I'm not sure if it is possible, but I would like to be able to automatically create (if not existant) or select (if already existant) the entry in the
entry field
. FeedMe does the same.Steps to reproduce
Form settings
Craft CMS version
4.10.2
Plugin version
2.1.19
Multi-site?
Yes
Additional context
No response