Pre-populate contact information - kentico

If a person has previously filled out a contact us form on our website, the next time they visit that form I would like their information pre-populated. Using Kentico EMS and the form builder, how can I make that happen?

you can access the contact informant via macros or custom macro methods and place it in the contact form default values (I would use an alternative form), but often you do not know if the user already exists unless they are logged in or enter the same email (which you would then need to add a client side trigger to Ajax an api once the email field is filled out, check for that contact in the api, return json of their info and populate the form).
to build the api you can either use the Kentico rest service or if you need more flexibility use the web part to api coupled with a repeater with custom query, adding the right where condition through macros.

Related

How can I create a template with fields that is view only? [DocuSignApi]

I have a template that is configured with a recipient that has read only fields and only a signature control. The read only fields/tabs are populated in the view request my API sends to DocuSign to get the signature url. However I'd like to create a new duplicate template that does not have the signature control and is configured to only require the recipient to view the document. This way the only signature event that is set by DocuSign is "viewing_complete" and not "signing_complete" when they're done viewing the template/document.
Edit: The purpose of this is it gives the user a read only view of the template/document so they can catch any errors in the mapped fields/tabs to give them a chance to correct it before signing a final version.
Not sure if you want to create this template from the API or from the web app.
You can easily do this from the web app and if you want to do from the API, you can get a log of the API calls to see how it was done.
When you create a template from the web app, in the first screen, you can pick recipients and there's a drop down with different types of recipients:
Select the "Needs to View" recipient type for your needs.
It's not possible to configure a template to accept populated tabs for a recipient that is set as Needs to View or to preview an envelope recipient view and have the tabs populated, but not show the Signature control.

Dependent controls functionality in Azure AD B2C Signup page

I am using the AD B2C custom policies to achieve the Sign-in and Signup.
In the Signup page, I need to have a dependent controls functionality. Like, once I enter a value in a text box and focus out, a rest API call should be made to pull the information from the Database and need to display that information in the next controls in the read only mode.
For example,
If I enter a postal code, It should auto populate the city information
If I choose a city, It should auto populate the state and country details.
Please suggest a way to achieve this scenario.
You can use javascript with the custom policies for your requirement. Once the postal code is entered in the text filed you can call an REST API and generate a dynamic dropdown box with javascript to bind the city details based on the dropdown selection you can bind the required filed.
There is a sample similar to you requirement. Please refer this it will be helpful

Calling an api in Azure AD B2C custom policy for postal address validation

I've been tasked with setting up our company's Azure B2C environment. I've made a lot of progress and have had to use Custom Policies, as the default User Flows don't give us enough flexibility.
One of the requested features is to have a section in the SignUpOrSignIn policy, so that when a user signs up for the first time, we want to validate their postal address through an address validation api provided by a third party.
The way the api works, is first you pass in the post code, eg: AA11 1AA. The response will include a list of all the available addresses for the provided post code. You then call the api a second time with the unique id of the selected address, and this time the response breaks the address details out into each of its parts, eg: Line 1, Line 2, Town, County, Post Code.
So far I have an input for the postcode in the UI. I need to take this value and pass it to the api.
I now want to be able to display the list of addresses to the user in a DropdownSingleSelect list. Is it possible to dynamically populate these, rather than hard coding into the xml file? I also need to hide this list until it is populated.
Then after displaying the list to the user, they will select their address. This will then need to submit a second call to the api with the unique id.
Then the response needs to be populated into each of the address fields which are hidden up to this point. I also need to prevent the button at the bottom of the page to create the user from being active until this sequence is complete.
Are these actions possible? Or are the requirements too complex for B2C? Any suggestions?
You can generate a dynamic dropdown box with javascript and some hidden fields rendered by B2C after getting the details from the REST API.
See this sample:
https://github.com/azure-ad-b2c/samples/tree/master/policies/selectemail

Sitecore 9 forms - capture input from form then put that information to exm email template

How do you get the user input (e.g. First Name, Last Name etc...) from sitecore 9 forms then put that to exm email template before sending the email?
What i want to achieve is for example: I have a form that have first name, last name and position and comments field and i want that user input data (first and last name, position and comment) to be pass on the email template that on the EXM and send it as an email upon clicking the submit button in the form. Is that possible?
You need to update the contact details, you can do that with a custom save action.
It is documented on the Sitecore doc website see:
Walkthrough: Creating a custom submit action that updates contact details
This are the steps:
Create a submit action class
Create the SPEAK editor control
Add a folder that contains parameters for the editor
Create the client script for the editor
Create a submit action item
The following blog explains Sitecore Forms Send Email Campaign message alternative you can also create an custom sent e-mail or if you need other examples of custom Forms extensions see Sitecore-Forms-Extension-Pack

How can an InfoPath form get the Claims of the user who is logged in to SharePoint?

We have a document library that contains a list of proposals (InfoPath Forms). Users log in through SharePoint using Claims (Forms Auth, via an Extranet) who are from various organizations. The forms open in InfoPath on the client. The InfoPath form contains a field for what organization the proposal belongs to (a select list) that the user then selects when filling the form.
We have written a custom claims provider that augments each user's login with an organization claim.
When the user opens a proposal from SharePoint in the InfoPath form filler, we'd like to:
Pre-populate the organization select list with the organization
matching the user's claim
Restrict the saving of the form (inserting and updating) if the
user's claim value for organization does not match the selected
organization on the form
I'm wondering how to get the claims information in InfoPath. Or, for ideas on how to do this server-side using a custom workflow/event receiver/web service (or something else).
Here is a basic tutorial for getting claims from SharePoint 2010. Place this in the code behind of your InfoPath form. http://msdn.microsoft.com/en-us/library/ee535731.aspx
Ideally you want to call the code from the FormEvents_Loading method of your InfoPath form and if the user's organization is invalid, create a bool, that if false, will prevent the form from submitting. This would be done in the FormEvents_Submit method.
I'm not sure if this works for your specific implementation however, you can set the data source for input controls (drop down lists, list boxes, etc) to be retreived from a web service.
You can then use hidden fields on the eForm which are populated with the metadata you need such as the user Id. These values are subsequently passed to the webservice and the return (List or whatever) are bound to the desired controls within the eForm.

Resources