Picture of Prepopulate Data Script (MegaEdit)

Prepopulate Data Script (MegaEdit)

Fill fields on your MegaEdit products with details from your customer's account, such as their name, company, address and email.

Fill MegaEdit Fields from Your Customer's Account

Fill fields on your MegaEditInfigo's browser-based product personalisation editor, used to build and configure dynamic templates that end users customise online (text, images, clipart, masks, backgrounds, and more). products with details from your customer's account, such as their name, company, address and email.

Guide8 min readVideo11-step guideUpdated 16 Oct 2026

Overview

The Prepopulate Data script fills fields on a MegaEdit productA product type in Infigo that uses the browser-based MegaEdit editor to let customers personalise templates online. with details from the customer's account. When a customer opens a business card, letterhead or name badge, their details are already on the design, so they don't have to type them in.

What it does

  • Fills fields as the editor opens - each field you set up shows the customer's details the moment they open the product.
  • Many data types - including the customer's name, title, gender, email, company, address lines, city, county, postal code, country, phone and mobile numbers, fax, date of birth and language, plus the job and product numbers.
  • Images and barcodes too - an image field can show the customer's avatar, and a barcode field can be filled with any of the text data types.
  • Always up to date - details are filled in again every time the editor loads, so changes to the customer's account show up the next time they open the product.

How it works

  • MegaEdit product > Scripts tab - tick Prepopulate Data and click Save changes.
  • Editor > Prepopulate Data - select a field, choose its data type in Setup Prepopulate Data, and click Save.
  • Menu > Save as product default - saves the set-up for every customer.

Good to know

  • Where the details come from: if any address or contact detail is filled in on the customer's Customer Info (address, town, postcode, country, county, company, phone or fax), every field is filled from Customer Info (apart from fields set to use the billing or shipping addressThe destination details for where an order should be delivered, usually including recipient name, location, and contact information.). A country counts, so most customers with a country set use Customer Info. If none is filled in, the name, email and address come from the customer's billing address, or from their first saved address if they have no billing address; title, date of birth, gender and language are then left empty.
  • Missing details leave the field empty: if the customer's account has no value for a data type, that text or barcode field is cleared rather than showing the sample text. An image field keeps its sample image if the customer has no avatar.
  • Customer edits don't stick: the details are filled in again every time the editor loads, so anything a customer types into a filled-in field is replaced. Don't set up fields you expect customers to change.
  • Custom fields: to fill a field from one of the customer's custom fields, type prepopulate_Custom1, prepopulate_Custom2 or prepopulate_Custom3 into the field's Tags box, exactly as shown (the capital C matters). See step 10 of the step-by-step guide.
  • Template editors see the set-up view: a login that can manage MegaEdit templates always sees the sample text and the Prepopulate Data button, never its own details.

Before you begin

  • You need a login that is allowed to manage MegaEdit templates. If you don't see the Prepopulate Data button in the editor, ask your main administrator or Infigo Customer Support.

Step-by-step

  1. Turn on the Prepopulate Data script

    Go to Catalogue > Product Types > MegaEdit > MegaEdit Products and click Edit next to your product. Open the Scripts tab, tick Prepopulate Data and click Save changes. The script now runs every time this product opens in the editor.

    Scripts tab: Prepopulate Data ticked

    Scripts tab: Prepopulate Data ticked
  2. Open the template as a template editor

    Open the product on your storefront and click Start, logged in with an account that is allowed to manage MegaEdit templates. The editor then shows the template's sample text and a Prepopulate Data button in the top bar, ready for you to set up the fields. The button stays greyed out until you select a field. If you can't see the button, your login needs permission to manage MegaEdit templates: ask your main administrator or Infigo Customer Support.

    The Prepopulate Data button in the top bar

    The Prepopulate Data button in the top bar
  3. Select a field

    Click the text field you want to fill in, for example the name on a business card. The Prepopulate Data button becomes available. Text fields, image fields and barcode fields can be set up this way.

    The Full name field selected

    The Full name field selected
  4. Choose the data type

    Click Prepopulate Data. In Setup Prepopulate Data, choose a value from Select the data type, for example Customer Full Name, and click Save. The list includes the customer's name, title, gender, email, company, address lines, city, county, postal code, country, phone and mobile numbers, fax, date of birth and language, plus Job Id and Product IdA unique identifier given to an individual product on your Storefront. For an image field, the only choice is Customer Avatar.

    Select the data type: Customer Full Name

    Select the data type: Customer Full Name
  5. Repeat for each field

    Do the same for every field you want filled in. On this card, Company uses Company Name, the address lines use Customer Address line 1, City and Postal Code, and the last line uses Customer Email. Each field has one data type. When you reopen the dialog on a field that is already set up, it shows the data type you chose. If you've added billing_ or shipping_ to a field's tag (step 10), don't change that field from this dialog again: choosing a data type there and clicking Save removes the prefix.

    Company field: Company Name

    Company field: Company Name
  6. Save as the product default

    Open Menu and click Save as product default. This saves the field set-up into the product, so every customer gets it. The sample text you see is only shown to template editors. For a customer, each set-up text or barcode field is replaced with their details, or left empty if their account has no value for it. An image field keeps its sample image if the customer has no avatar.

    Menu > Save as product default

    Menu > Save as product default
  7. Check where the data comes from

    Go to Customers, find the customer and click Edit. Their details are on the Customer Info tab. If any address or contact detail is filled in here (address, town, postcode, country, county, company, phone or fax), every field on the product is filled from Customer Info, apart from fields set to use the billing or shipping address (step 10). A country counts, so most customers with a country set use Customer Info. If none is filled in, the script uses the customer's billing address, including the name and email, or their first saved address if they have no billing address. Title, date of birth, gender and language are then left empty.

    Customer Info: name, company and address

    Customer Info: name, company and address
  8. Open the product as a customer

    To test, impersonate a customer (or log in as one) and open the product. Impersonating fills in that customer's details. Use a customer who can't manage MegaEdit templates: anyone who can always sees the sample text and the Prepopulate Data button, never their own details.

    The customer clicks Start

    The customer clicks Start
  9. Check the filled-in design

    The fields show the customer's details as soon as the editor opens: here the name, company, street, town, postcode and email from their account. The details are filled in again every time the editor loads. Changes to the customer's account show up the next time they open the product, and anything the customer types into a filled-in field is replaced. There is no Prepopulate Data button for customers.

    Name, company, address and email filled in

    Name, company, address and email filled in
  10. Find or change a field's data type

    Each set-up field stores its data type as a tag. To see it, double-click the field in the editor (with a login that can manage MegaEdit templates), open the last tab, Details, and look at Tags, for example prepopulate_postalcode. To always use one of the customer's addresses for a field, add billing_ or shipping_ after prepopulate_, for example prepopulate_shipping_postalcode, then save the product default again. That field then only uses that address: if the address has no value for it, the field is left empty. To fill a field from one of the customer's custom fields, type prepopulate_Custom1, prepopulate_Custom2 or prepopulate_Custom3 into its Tags box, exactly as shown (the capital C matters). If a field has stopped filling in, check that its tag is still here: a field without a prepopulate_ tag keeps whatever text was saved in the product default.

    Details > Tags: prepopulate_postalcode

    Details > Tags: prepopulate_postalcode
  11. Change the address rules (optional)

    On the MegaEdit product's Scripts tab, click Config next to Prepopulate Data. Enter { "disableAddressValidation": true } and save to always fill fields from Customer Info, even when it has no address details. Enter { "legacyMapping": true } for the older rules: the name, email and language come from the customer's account and everything else comes from the billing address, or the first saved address, or Customer Info if the customer has no saved addresses. The billing_ and shipping_ tags have no effect with the older rules. Leave the Config empty to use the standard rules described in step 7.

Video transcript

Overview video

0:00 Fill MegaEdit fields from your customer's account

0:04 The Prepopulate Data script fills fields on a MegaEdit product with details from your customer's account, so they don't have to type them in.

0:13 Here, a customer opens a business card from the storefront.

0:17 Their name, company, address and email are already on the design, taken from their account when the editor opens.

0:25 The details come from the customer's account: their Customer Info, or their billing address when Customer Info has no address or contact details.

0:34 It's set up on the MegaEdit product, field by field. The step-by-step guide on this page shows how.

Step-by-step video

0:00 Set up the Prepopulate Data script

0:03 In this video, we'll set up a business card that fills in the customer's name, company, address and email. You'll need a MegaEdit product, and a login that can edit MegaEdit templates.

0:15 In the admin area, edit your MegaEdit product and open the Scripts tab. Tick Prepopulate Data, then click Save changes.

0:24 Now open the product on your storefront and click Start. Because your login can edit templates, the editor shows the sample text and a Prepopulate Data button.

0:34 Select the field you want to fill in. Here, it's the name. The Prepopulate Data button becomes available.

0:42 Click Prepopulate Data, choose Customer Full Name from the list, and click Save.

0:48 Do the same for the other fields. The company field uses Company Name, and the address and email lines use their own data types.

0:57 Open the Menu and click Save as product default, so every customer gets this set-up.

1:03 The details come from the customer's Customer Info. If Customer Info has no address or contact details, the script uses their billing address instead.

1:13 To test, impersonate a customer, or log in as one, and open the product. Template editors always see the sample text, never their own details.

1:23 The card opens with the customer's details already filled in. They're refreshed every time the editor loads.

1:31 That's it. The step-by-step guide on this page has every setting and data type.

Troubleshooting

Troubleshooting

  • The Prepopulate Data button isn't in the editor - check the script is ticked and saved on the product's Scripts tab, and that your login is allowed to manage MegaEdit templates.
  • Fields show the sample text when you test - you're probably logged in with a login that can manage MegaEdit templates; these never see their own details. ImpersonateWhen logged into Infigo as an administrator, you are able to "Impersonate" other customers from the Customer Management screen. a customer, or log in as one, instead.
  • The details come from the wrong address - see "Where the details come from" above. A country or company on Customer Info is enough for Customer Info to be used. To force one address for a field, add billing_ or shipping_ to its tag (step 10 of the step-by-step guide).
  • A field has stopped filling in - open the field's Details tab and check its Tags box still starts with prepopulate_. If the tag was removed, the field keeps the text saved in the product default; set the data type again and save the product default.
  • A field is empty for some customers - their account has no value for that data type, so the field is cleared. Add the detail to their Customer Info (or, if their Customer Info has no address or contact details at all, to their billing address), or choose a different data type.
TipTest with a customer login, or impersonate a customer from the admin area. Impersonating fills in that customer's details, so you can check the result without logging out.

Search terms

Guide | Fill MegaEdit Fields from Your Customer's AccountLast updated: 16 Oct 2026
Incomplete