Pre-filling customer details

This guide describes how to prompt a user to sign into their account in order to pre-fill their customer details, and how make the relevant form fields pre-fill. 

Creating a sign in prompt

A sign in prompt is a block of text in a 'grid' that contains an instruction and link for the user to sign in to their Hantsweb account.  To add one to your form page, you first need to create the grid. 

Go into Common Content > Grids > Signinforms in Sitecore Content Editor.

Signinforms folder under grids

Create a duplicate of an existing sign in grid (example):

Example sign in grid 

Re-name it to something that relates to your form.

The grid will contain an info block like this:  

Sign in info block

Edit the ‘sign in’ URL so that the callback will return the user to your form page, once they have signed in, e.g.:
[LINK NEEDED]

 
Adding the sign in prompt to your page

1. Find your form page in the Sitecore content tree and go into Experience Editor (Publish>Experience editor)

2) Insert a component. To do this go to Home>component. Select an appropriate placeholder, and click 'Add here'. Then choose Rendering>building block>Navigation>Grids>12.

3) Select 'Select existing content' and select the grid you created earlier

4) Your grid will now appear on the page

 

 

Making the sign in prompt disappear once the user is signed in

In Experience Editor, click on the personalization icon (the 3 people Personalization icon) above your sign-in grid. 

Menu bar above a sign in grid

You will get a Personalize box. Click on the plus sign Add button to add a new rule. 

Give the rule a name, e.g. ‘SignedIn’, then click the Edit rule button Edit rule button

You will get a Create Rule box.  Select ‘where predefined rule is true’:

Create Rule box

This will add a rule into the Edit rule box below.  Click on the link ‘predefined rule is true’:

Edit rule link

Then select ‘visitor is signed in’ and OK the rule.

Visitor rules list 

You then need to use the ‘Content:’ box to browse for your grid.  Once, you’ve found it it will appear as below:

 Content box containing a grid

Finally, click on the ‘Hide’ radio button, so that the grid will be hidden when the visitor is signed in:

Hiding the grid 

You also then need to set the Default condition to show your grid if none of the other conditions are met, as below:

 Default Condition example

Forcing users to sign in

In rare situations, you may need to force the user to sign into their account before using your form.

An example of this is the Concessionary Travel Pass Replacement form.  The customer must be identified as the owner of a travel pass before they can get a replacement.  Signing in enables this.

You need to set personalization rules on the page your form is on to say that the user must be signed in to view the page.

In Sitecore Content Editor go to the Security tab and select Assign Assign button 

Click on Add Add button and wait a while for the ‘Add an Account’ box to appear.

Access Level 1 role

Select the Role ‘extranet\Access Level 1’ (if you want customers with access level 1 to use the form) and click OK. Set the permissions for this role to match the permissions shown below:

Assigning permissions for Access Level 1 

Click Add again and select Users to add the extranet\Anonymous user:

 Anonymous user

Set the permissions for this user to match the permissions shown below:

Assigning permissions for the anonymous user 

The permissions for Everyone should look like this:

Permissions for Everyone 

OK these permissions, save and publish the page.  When the user goes to the URL for your page, they will be redirected to a screen like this:

Sign in page 

Once they have signed in, they will be directed to your page and will be able to use the form.

Pre-filling details from the Customer Account into the form fields

Find the form field you want to pre-fill in Sitecore Content Editor, e.g. First Name, and go into the dropdown list on the field property called ‘Default value datasource’.  Select the data item you want to pre-fill the field with, e.g. C4CFirstNameFromProfile.

Selecting first name as the default value datasource

Note: All the fields available from the customer’s profile are prefixed with ‘C4C’.

A quick way to achieve the pre-filling of customer contact details in your form is to copy a form step containing pre-filled contact details from another form.

Note: there is currently a bug about prefilling the address field. Once resolved, the information will be added here on how to do that.