-
khartoughAsked on May 6, 2025 at 7:22 PM
Hello,
I am looking to create a JotForm that takes basic information from a user and a unique code that is distributed to them prior to filling the form out. The unique code field needs to be referenced with our Salesforce contact records to allow a dynamic PDF to be produced for the applicant.
The verification of the unique code is the step that I just want to verify that I am doing right. All integrations have been implemented but any help to fulfill this form would be greatly appreciated.
-
John JotForm SupportReplied on May 7, 2025 at 4:00 AM
Hi Kyle,
Thanks for reaching out to Jotform Support. You can try using our Salesforce Prefill feature. This lets you dynamically prepopulate your forms with data from your Salesforce CRM using lookup filters you've set up, which, in your case, could be the unique code. It's easy to set up. Let me show you how:
- In Form Builder, in the orange navigation bar at the top of the page, click on Publish.
- Click on Prefill in the menu on the left side of the page, and then select Salesforce Dynamic Prefill.
- You'll have the option to select from the existing Salesforce connections, or simply connect to a new account by clicking on Use another account. If this is your first time connecting the form to Salesforce, just click Authenticate and follow the prompts.
- Next, select a Salesforce object from the Lookup Object dropdown where the data for prefilling the form will come from. I used email and matches that with the email field of the form. In your case, you can use the Unique Code field, but make sure it's linked to an Account or Contact records in Salesforce for the prefill to work.
- Under the Map Fields section, Name and Email are added by default. If you'd like to include more data, just click on Add Field to add another one.
- Click on Save, then click Yes, Save from the window that opens, and you're done.
That's it. You can copy the link under the Share with Link section, then share it to your users either by email or any messaging platform you wish to use. Here's an example of how it works in my test form:
After we hear back from you, we’ll have a better idea of what’s going on and how to help.
-
khartoughReplied on May 7, 2025 at 9:02 AM
John,
Thank you for sending over these steps about Salesforce Prefill. I have implemented these steps, and that is a great solution but I am still looking for another step.
With the pre-fill assistance you gave me, my initial email and unique code field will trigger the prefill if look-up filters match. However, what I am looking for is if the required fields (email and unique code) do not match, the applicant cannot receive the dynamic PDF.
How can I accomplish this?
Sample Scenario:
Prospect fulfills presentation > email is sent providing them a unique code that has been populated by salesforce field > Prospect uses that code within a JotForm to receive a gift in the version of a PDF.
*That code needs to be verified with Salesforce code when used within the JotForm.
-
Deanne JotForm SupportReplied on May 7, 2025 at 10:14 AM
Hi Kyle,
With Salesforce Prefill, if the form fields do not match with your Salesforce fields, then it will not prefill anything on your form. In your case, if the email and unique code on your form do not match the email and unique code record in Salesforce, then it will not fill the fields you set on your form. You can set the fields to be filled as required so when it won't get filled when the email and unique code do not match, they won't be able to submit the form, therefore not receiving the attached PDF via email. If you're having trouble with it, you can take a screenshot of which part of the form you need help with so we can have a better idea. This guide will show you how to do that.
Keep us updated and let us know if you need any more help.
-
royalmotors555pkReplied on May 7, 2025 at 11:28 AM1. Set Up the Unique Code Field in Jotform
- Add a Textbox field to your form where users can input their unique code.
- Enable "Required" to ensure the field isn’t skipped.
- Use Jotform’s Data Source feature to query Salesforce:
- Go to Form Builder → Salesforce → Add Data Source.
- Configure the Salesforce API connection (if not already done) to query the Contact object where Unique_Code__c (or your custom field) matches the user’s input.
- Example Salesforce SOQL query:
- sql
- Copy
- Download
SELECT Id, Name, Email FROM Contact WHERE Unique_Code__c = '[Unique_Code_Field]'
- Map the Jotform unique code field (e.g., input_1) to the Salesforce query parameter.
- Use Jotform Rules to check if the code exists in Salesforce:
- Condition: If the Salesforce Data Source returns no records.
- Action: Show an error message (e.g., “Invalid code. Please try again.”) and prevent submission.
- Success Path: If the code is valid, store the Salesforce Contact ID in a hidden field for later use.
- Use Jotform’s PDF Editor to design the template:
- Pull data from the Salesforce Data Source response (e.g., Contact Name, Email) into the PDF.
- Use hidden field values (like Contact ID) to reference Salesforce data dynamically.
- Configure the PDF to auto-generate upon successful submission.
- Submit a test form with:
- A valid code (ensure the PDF generates with correct Salesforce data).
- An invalid code (confirm the error message appears).
- Check Salesforce API limits and error logs for issues.
and if you like please visit this site .
Your Answer
Something Went Wrong
An error occurred while generating the AI response. Please try again!