cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cnorris135
Helper IV
Helper IV

Powerapps field validation question

Question..... and i think im close....

 

I have a field called Temperature (number field in sharepoint).  I want to put a range that the users can enter into it.  I also added a label.  i added this code and it works EXCEPT the Reset part.

 

If(Value(Temperature)<90 || Value(Temperature)>105,

     UpdateContext({ShowErrorMsg: true}); Reset(Temperature),

     UpdateContext({ShowErrorMsg: false})

)

 

i want to put this code on the submit button so that the user can NOT submit if the user is out of range.

 

i done understand why im getting an error on the Reset part of this.  I get a "Invalid argument type (Number), expecting a control value instead."  Not sure what that means. This is the only part of my code that is giving me an error.  What am i doing wrong here?

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @cnorris135 ,

Please notice the Reset function's usage:

The Reset function resets a control to its Default property value.

So if you want to use this function, you need to pay attention to three points:

1)you need to reset a control, not a variable

2)you could not reset a control which has Default property, not including label control (not have Default property)

3)you need to use this function in one action property

 

Based on the formula that you provided, it seems like Temperature is a fieldname. So you got that kind of error message.

Could you describe more clearly about the feather that you want? Do you want to reset the textinput for Temperature field? or anything else?

If my assumption is right, you could try this:
Reset(Temperaturetextinput)           //please replace with your control name

 

Here's a doc about this function for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-reset

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
eka24
Super User III
Super User III

Please you stated that Temperature is a Column in your list. What is the name of the Textbox to that users will enter the value 90.

The red error is that before you are reset a column instead of the Textbox

.------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

If this error is happening in the label then the reason is that Reset() can't be used in a label but it can be used in a button. If you add this formula to the button the error should go away.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
v-yutliu-msft
Community Support
Community Support

Hi @cnorris135 ,

Please notice the Reset function's usage:

The Reset function resets a control to its Default property value.

So if you want to use this function, you need to pay attention to three points:

1)you need to reset a control, not a variable

2)you could not reset a control which has Default property, not including label control (not have Default property)

3)you need to use this function in one action property

 

Based on the formula that you provided, it seems like Temperature is a fieldname. So you got that kind of error message.

Could you describe more clearly about the feather that you want? Do you want to reset the textinput for Temperature field? or anything else?

If my assumption is right, you could try this:
Reset(Temperaturetextinput)           //please replace with your control name

 

Here's a doc about this function for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-reset

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,159)