cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

No way to have custom string format?

From my digging around, it seems the set of formats of columns of type Text, e.g. Email, Phone, URL etc. is baked into Dataverse. I would like to be able to create custom formats, for example using a format mask, but this seems impossible - it all seems to go back to this class , which is simply a pseudo enum, which I assume triggers some hard-coded logic.

 

This is rather a pain, and seems to fly in the face of dataverse's professed openness and flexibility. For the small library catalog I am developing, I already need two custom formats - ISBNs and RGBA colors.

 

Is there a way to do this? Am I missing something? Or is there a way we can have this in Power Apps?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @rampart,

The link that @timl is the method to do it out-of-the-box with Dataverse model-driven apps. But this is only front-end and will not be enforced from the server-side (API or database), same thing with JavaScript. It is possible to enforce it server-side but you'll have to revert to coding with plugins: https://docs.microsoft.com/en-us/powerapps/developer/data-platform/plug-ins

You can write a plugin that executes real-time (sync) on create or update of a record and validates the input. If it's not correct, the plugin should throw an InvalidPluginExecutionException with a message explaining to the user the input format is invalid.

Hope this helps...

View solution in original post

5 REPLIES 5
Regular Visitor

There is a featur request for this here: https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Text-Formats-for-Data-Entry/idi-p/172003.

If you agree, please upvote this.

Super User III
Super User III

Hi @rampart 

What type of app are you building? If it's a model driven app, you can use the input mask control. There are some more details my post here.

https://powerusers.microsoft.com/t5/Building-Power-Apps/Input-Mask-Custom-Control-on-Model-Driven-Ap...

 

Impactful Individual
Impactful Individual

Hi @rampart 

Is this for a Model-driven app? There might be a way to do it using JavaScript. What are you trying to do specifically?

Regular Visitor

Thanks all. I'm using a model-driven app. I'll check out @timl's post. I would really prefer to have my mask enforced in dataverse, though...

Hi @rampart,

The link that @timl is the method to do it out-of-the-box with Dataverse model-driven apps. But this is only front-end and will not be enforced from the server-side (API or database), same thing with JavaScript. It is possible to enforce it server-side but you'll have to revert to coding with plugins: https://docs.microsoft.com/en-us/powerapps/developer/data-platform/plug-ins

You can write a plugin that executes real-time (sync) on create or update of a record and validates the input. If it's not correct, the plugin should throw an InvalidPluginExecutionException with a message explaining to the user the input format is invalid.

Hope this helps...

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Users online (25,144)