Giter VIP home page Giter VIP logo

Comments (6)

engram-design avatar engram-design commented on June 30, 2024 1

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!)

from formie.

svondervoort avatar svondervoort commented on June 30, 2024

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.

from formie.

engram-design avatar engram-design commented on June 30, 2024

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?

from formie.

svondervoort avatar svondervoort commented on June 30, 2024
  • At first I just entered the title (in this case 2024/2025) for a non-existing Entry in the mapped Entry section which gave me the error.
  • In the test I used an existing id of an entry in the mapped Entry section which did work.
  • I also tried using an existing 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.

from formie.

engram-design avatar engram-design commented on June 30, 2024

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:

  • How will it know which section/type to create the entry for? An Entries element field can have multiple sources. You'd also need to map or select when of these to use.
  • What about if there are additional required fields needed to create the entry more than just title? You'd probably need a method to map against those fields as well, which is starting to get 3 levels deep in element-handling.

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.

from formie.

svondervoort avatar svondervoort commented on June 30, 2024

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).

Screenshot 2024-06-20 at 12 00 59

from formie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.