autofill with repeating groups

madpato

Member
Hello

How can i map an autofill plugin on a form who has a repeating group?
Here is what i need (again with the date thing...):

- A form with 12 repeated fields (date element) on a repeating group. Already got this here
- I need to pass the 12 elements (different dates) to another form who also has a repeating group (fixed 12 options to match the 12 of the other form, here). THIS is what i cannot achieve

I am trying to use the autofill plugin but i am having some problems with the data maping, can you please help me?
 
I'm not entirely sure the autofill plugin will do that.

So just to be clear ... you want to have an autofill trigger in one of the non-repeated elements on Form 2, which pulls the data from however many repeated instances there are of a repeat group on Form 1, and create / add that many repeats of a group on Form 2 to hold that data?

-- hugh
 
Yes that exactly, but the form 2 is also a repeated group, and also this needs to be read-only. I dont mind the type of element (field, date, calc, whatever) as long as i can do that: pass the dates of form A to form B.

Thanks.
 
OK, update ...

We spent about 3 hours on live chat today, and sorted out a few things. I've modified the autofill code so it recognizes when the 'target' data is repeated (it's a JS object after being decoded fro JSON, rather than a string), and if so, it attempts to do a (not very intelligent) match, from the index of each of the repeated values, to a "repeat count" of the target element.

In other words, this won't work if you don't already have X number of target repeat groups which match the X number of repeats coming from the autofill. We won't attempt to automatically create target groups if they don't aready exist on the form. Which will work in your case, as you pre-create your 12 groups on the target form, and always have 12 repeats coming from the source data.

Anyway ... I'll go and apply those changes in github now.

NOTE - I set your site to "Debug JS" in the main Fabrik options, so it's using uncompressed JS. Don't turn that off yet, as the changes I made are only in the uncompresed JS, I need to rebuild the compressed files in github, and get them loaded on your site.

We'll pick up where we left off tomorrow.

-- hugh
 
I'm awake and working, so find me on Live Chat when you are ready. I won't be able to do a 3 hour session today, maybe an hour or so, as I still have a lot of forum catch up work to do. But we should be able to get some stuff achieved.

Note ... you mentioned something in passing on chat about another repeat group that needs to be filled in, which needs a variable amount of elements. That may not be possible, at least in the short term. The code I added to autofill to do your 12 dates isn't "smart", it assumes that you have set things up so the number of repeats in the "from" data matches the number you want to fill on your target form. So the autofill code does not attempt to create repeat groups on the target form if they don't exist.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top