• New Commercial Services Section

    We have now opened a commercial services section here on the forum. If you have a Fabrik project that you wish to have someone work on for you, post it under Help Wanted. If you are an application developer and wish to earn some money helping others, post your details under Fabrik Application Developers.

    Both of these are unmoderated. It will be up to both parties to work out the details and come to an agreement.

Autofill setup

deono

Member
Hello,
I'm having trouble getting the autofill plugin to fill in the fields.

I followed the tutorial many times and thought I thought did everything right, but the search finds nothing after making a selection. Seemed like a piece of cake in the video. I know it's a different version from the tutorial so I'm guessing I missed something. The map data looks right.

I have a user login/profile form and another form watching the phone field, (I set this to auto complete element so user enters the phone they are searching for) when a phone number is entered and found I need to display the name, address, etc. in the matching fields.

I'm using joomla 3 and the latest Fabrik from github.

Is there anyone that can help?
 
Yes I have, I actually have it set to that now. The phone number in the record is there, I select it, the system searches, but the name field is not filled in.
 
I still can't get this to work. I have a fabrik admin setup if someone would rather look and see what I've done wrong. I'm trying to get fields from the user profile form to show in the delivery form. Just the name field is in there now, want to merge all address info once the name field is working.
 
I changed the quotes before when it wasn't working thinking I might have typed it wrong, thanks.

I've updated the file you linked. This doesn't seem to fix my issue though.
 
I have a couple of grasping at straw questions:

1. Is JSON something extra I need to install or setup?
2. Could my using a capital letter in my elements name be causing any problems with the autofill plugin?

Best of luck to Hugh! Hope you have a quick recovery and feel well enough to return soon.
 
Looking at this again now. When you say:

I've updated the file you linked. This doesn't seem to fix my issue though.

... did you just update that one file, or do a full github update? You should never just update single files, you need to do complete github updates, bygrabbing the ZIP from:

https://github.com/Fabrik/fabrik/archive/joomla3.zip

... un-zip it, and upload the entire content, overwriting existing files.

I'll take another look at your site now though.

-- hugh
 
I have a couple of grasping at straw questions:

1. Is JSON something extra I need to install or setup?

No, it's built in to PHP and JavaScript.

2. Could my using a capital letter in my elements name be causing any problems with the autofill plugin?

As long as you always capitalize it exactly the same everywhere, it's not a problem. Typically I don't ever capitalize names, so I don't have to remember how they are capitalized when I use them. I'm not a big fan of CamelCase, I prefer to use underscore_names when I need to separate words.

Best of luck to Hugh! Hope you have a quick recovery and feel well enough to return soon.


I'm having a rough recover from this one, and unfortunately it looks like I may need some more surgery.

-- hugh
 
OK, well, I've "fixed" it, by removing the "Lookup field" you had set on the autofill settings, which is incorrect - you are looking up by the Primary Key, via that phone join, so you don't neeed to specify that you are looking up by something other than the PK. But having looked at your list stucture, this isn't going to do what you need as-is.

You are trying to fill the delivery address on your order form, using an autofill which uses the 'phone' from your user's profile table. Which is OK so far ... like, the email and the customer name can be filled from the profile table just fine. BUT ... the actual address is a one-to-many join on your profile table, i.e. you allow multiple delivery addresses on their profile, which are stored in another table.

This means that Fabrik has no idea which of the multiple addresses you want to use. You are just looking up the profile row, via the profile row's PK. So we can return fields from the profile row, like the name and email. But fields from the repeated (joined) profile address table rows, we have no idea which one you want.

So ... it'll have to be a two step process. Select their profile - which is now working, by the way. I removed those repeated fields from the JSON map, and it correctly returns the name and email. Then you'll need a second autofill, which lets them specify which of their addresses they want to use.

I'll have a go at setting that up for you.

-- hugh
 
Thank you so much! I was confused thinking "lookup the phone number", but I think get it now, it just needs to watch for the change in the phone field.

I was worried I might have problems with those extra addresses, thanks for giving it a go. I was hoping to have them select an "address title" after the phone number lookup to fill in the appropriate address. Figured I'd try that after we got the name/email to show.

Sorry to hear you may need yet another surgery. My sister had to have her back surgery done 3 times, and it still only kinda fixed her issues.

Thanks again for helping while your having such a bad recovery, I'm sure it's not easy to sit there let alone think and figure our my mess.
 
OK, I've set up how I think you wanted it to work ... so you select the Phone, which loads the basic profile details (name and email). That's the (now working) autofill you originally set up. I also turned off the confirmation prompt for the autofill.

Then I added a "Which Address?" CDD (c ascading dropdown) element, which watches the main "phone" join, and populates itself with the addresses belonging to the chose profile. Then I added a second form autofill on that CDD, which loads the chosen address details into the remianing address fields on the order form.

NOTE - because the CDD element can only "see" Farik Lists (unlike the join element, which can "see" any table in yoru database), I had to create a Fabrik List using the user_profile_4_repeat table, so I could then select that to use as the List for the "Which Address?" CDD. That's th eonly thing that "User Profile Addresses" list will be used for, you can pretty much ignore it.

It's not exactly perfect, it could do without a couple of the pointless lookups it's doin on page load ... but let me know if the form is now working how you needed it.

-- hugh
 
The form/autofill is working great in the backend, but now It's not working in the frontend. It worked for a few times, but then the phone field stops searching.

I'm not sure what I broke.
 
Sounds like a JS issue.
Can you see any JS error?
Did you try with the standard Protostar Joomla template?
 
Thanks! That did work. I wasn't seeing any JS error, but I changed the default template to protostar for the form and it seems to be working now. Not as pretty as our main template but at least it works. I'll keep testing to be sure it doesn't stop after a few submissions, but looks like this is fixed.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top