cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate III
Advocate III

MaxLength Circular Reference Issue

Hi,

 

I'm running into an issue with a formula and it should be super simple but I cannot get it to work. I have a text field, TextInput2 and I want to change the MaxLength based on what the text in the field starts with. So, in the MaxLength field I entered this formula:

 

If(StartsWith(TextInput2.Text,"PEO"),10,8)

 

Again, pretty simple and it should do exactly what I need it to. Except that "This rule creates a circular reference..." error. Any tips on how to overcome this? The field is an ID number field for two different types of ID numbers and based on the way it starts, we automatically know which type it is. I just want to tell it if it's type A it should be 10 characters and if it's type B it should be 8 characters. Thanks.

8-15-2018 10-43-36 AM.png8-15-2018 10-43-58 AM.png

4 REPLIES 4
Highlighted
Super User
Super User

Re: MaxLength Circular Reference Issue

Hi Rodi,

 

A possible solution is to add a Radio Control and set its Items property to ["PEO","###"].

 

Set the default of the textinput to If(Radio1.Selected.Value="PEO","PEO-","")

Set the MaxLength to If(Radio1.Selected.Value="PEO",10,8)

 

This avoids the circular reference and helps the users by loading PEO- into the TextInput box and allowing them to use the keypad in both cases.Maxlength.PNG

 

 

 

Highlighted
Community Support
Community Support

Re: MaxLength Circular Reference Issue

Hi @rodieremix,

 

 

I think the message should be clear enough to explain the situation.

As the Maxlength is used to define the actual string entered, it is not allowed to change its value based on the TextInput.Text.

 

The workaorund that would work should be providing additional reference for the MaxLength to determine the proper value, based on other control, or data has no relationship with the TextInput.Text property.

There is no methods that could change the Maxlength automatically, based on what I know.

 

Regards,

Michael

 

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Super User
Super User

Re: MaxLength Circular Reference Issue

Isn't this pretty much what I came up with?

Highlighted
Advocate III
Advocate III

Re: MaxLength Circular Reference Issue

Thank you both for the input. 

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,772)