cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rampart
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
rampart
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.

timl
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...

 

SeanHenderson
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?

rampart
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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Users online (75,017)