I’m making a form in CIJ that will create a new lead and save some product data provided by the submitter in a custom table related to the lead.
my question is: how i can do this when custom tables in dataverse requires a primary name field that must be text. And it’s not possible to have a deafult unique value from the dataverse definition. And it’s not possible in the form.
And having JS in CIJ is too volatile in CIJ form from maintenance point of view.
it’s hardly a unique use case so a bit surprised this seems to be a problem.
How have other’s managed to solve it?
Since CIJ Forms don't allow you to "map" a hidden static value to the Primary Name field, and you want to avoid the "maintenance debt" of JavaScript, you have to move the logic from the front-end (Form) to the back-end (Dataverse). Here are 3 possible solutions - 1. Instead of trying to force the form to provide a name, let the form create the record with a blank or dummy name, and let Power Automate handle the cleanup instantly.
In your custom table, make the Primary Name field Optional (Business Recommended) rather than Business Required at the Dataverse level.
Create an automated cloud flow that triggers "When a row is added" to your custom product table.
Use the Flow to concatenate data to create a meaningful name, such as: Product Interest - [Lead Name] - [Date].
The record is created by the form, and 2 seconds later, it has a professional, unique name.
2. If you don't need a "descriptive" name (like "Product A - John Doe") and just need the field to be populated to satisfy Dataverse, use the native Autonumber feature.
Go to your Custom Table in the Power Apps maker portal.
Change the Data Type of your Primary Name field from "Text" to "Autonumber."
When the CIJ form submits the related record, Dataverse automatically generates a value (e.g., REQ-1001) the moment the row is created. The form doesn't need to know the field even exists.
3. If you want the name to be available immediately for other real-time processes, developers often use a simple Synchronous Plugin or a Power FX Formula Column.
You can now set the Primary Name field to be a Formula column in some environments. You can set the formula to be something like Concatenate(ThisRecord.ProductType, " - ", ThisRecord.Lead.FullName).
A "Pre-Operation" plugin catches the data before it hits the database and populates the Primary Name field based on the other values submitted in the form.
if this helps pls mark as verified so that it may be helpful for someone else. Thanks!
Was this reply helpful?YesNo
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.