cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User
Super User

Parent.error?

What is "parent.error" in regards to form validation? 

 

The default error message that is auto-generated when creating a PowerApp from a Sharepoint form has its Text property set to parent.error. 

 

2018-06-07_9-56-28.png

 

Unfortunately, the parent (Data Card?) has no "error" property

2018-06-07_10-00-03.png

 

And neither does the Form: 

2018-06-07_10-00-29.png

 

Where is the mysterious .error property? I'm also interested in ErrorKind. I see the docs on them but cant seem to find them inside my app anywhere. 

11 REPLIES 11
Power Apps Staff LukeW-MSFT
Power Apps Staff

Re: Parent.error?

Hi!

In the PowerApps documentation there is a line regarding .Error:

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/working-with-cards

The Valid property is driven from the metadata of the data source, based on the DataField property. It's also based on the Required property and whether the Update property contains a value. If the value on the Update property isn't valid, the Error property provides a user-friendly error message.

 

You are correct that the parent is a DataCard control. The DataCard itself does not list the Error property because it is an output only property of the DataCard. It can be read by another rule but it cannot be set.

Super User
Super User

Re: Parent.error?

Thanks for the response @LukeW-MSFT. Here's my problem: I deleted the auto-generated asterisk and error message (basically negating all the aweseome built in error handling, rookie mistake) and now I need to manually rebuild it. 

 

Unfortunately, when functions like Error are "hidden", I'm having trouble reverse engineering them. Any further insights on how to recreate the built-in form error handling OnSubmit?

 

I read the docs but they don't quite reveal what I need. 

Power Apps Staff LukeW-MSFT
Power Apps Staff

Re: Parent.error?

Hey again,

 

The way I see it you have a few options for rebuilding the data card and it's sub-controls (including the asterisk and error message):

1. Undo your changes back to before the delete.

2. Go back to an older version of your app, if you happened to save/publish before you deleted.

3. Create a new form based on your dataset if its not too much trouble, the new form will have all the defaults set like before.

 

I don't think it is possible to delete labels that are parented by a data card. So you must have deleted the entire card, right? If that is true, then another option is to: Select the form > In the properties tab on the right, select the data souce linked in the "Data" row > In the flyout pane select under "Fields" select the field you wish to bring back.

 

Hope one of these options works for you! If not, let me know.

Super User
Super User

Re: Parent.error?

@LukeW-MSFT

 

Directly after creating the app from a Sharepoint list (months ago) I deleted the Error Message and Star from each data card. The reason I deleted the controls is because once I renamed another Data Card element (label or dropdown I think), these two controls threw "!" errors due to the change naming. 

 

At the time I was new to PA and didn't think twice about deleting them ("Aha! Took care of those pesky " ! " 's). Now I'm feeling the pain here. Unfortunately, I can't go back to a previous version of the app to recover them nor can I delete the custom cards I've created and pull them in again (WAAAAAYYYY to much customization at this point). 

 

Hm. Looks like I'll end up controlling the Visibility of the red asterisk and the DisplayMode of the Submit Button based on the Dropdown/Text box values as there isn't a way to rebuild the native error handling once these controls are deleted. 

Super User
Super User

Re: Parent.error?

From the docs: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-form-detail#key-proper...

 

Valid – Whether a Card or Edit form control contains valid entries, ready to be submitted to the data source.

  • This property applies only to the Edit form control.
  • A Form control's Valid property aggregates the Valid properties of all the Card controls in the form. A form's Valid property is true only if the data in all cards in that form is valid; otherwise, the form's Valid property is false.
  • To enable a button to save changes only when the data in a form is valid but hasn't yet been submitted, set the button's Enabled to this formula:

    SubmitButton.Enabled = IsBlank( Form.Error ) || Form.Valid

 

Looks like Form.Error and Form.Valid Properties are not exposed in PowerApps. This is blocking me from rebuilding the error handling. Do you know how to get this functionality back? 

Power Apps Staff LukeW-MSFT
Power Apps Staff

Re: Parent.error?

Not sure I understand fully. You should be able to read output properties like Form.Error or Form.Valid as I exemplify below. Can you screenshot the error message you get when you try to use these properties?

image.png

 

Super User
Super User

Re: Parent.error?

I'm having trouble figuring out exactly what is going on. This is probably TLDR, but if you have the stomach to continue assisting, here it is 🙂

 

Dropdown Items has a blank option. I've also tried Blank() as an option, no go. 

2018-06-07_15-44-17.png

 

Error Message set to Parent.Error

2018-06-07_15-12-35.png

 

Red Asterisk: If Parent.Required is true and the dropdown is blank, show the asterisk. 

2018-06-07_15-45-30.png

 

//Doesn't work either: 

If(
    IsBlank(dropdown_input.Selected.Value),
    true, false)

 

Card (parent) is set to Required True and you can see the dropdown is blank BUT no red asterisk...

2018-06-07_16-06-51.png

 

AND.. when executing SubmitForm() the error message doesn't show up. 

 

Pecurliar because the Data Cards above are setup similar (Textboxes instead of Dropdown) and they work fine: 

2018-06-07_16-17-48.png

Power Apps Staff LukeW-MSFT
Power Apps Staff

Re: Parent.error?

Thanks for the detailed screenshots/info. Helps me understand. First, something simple, have you tried this for the asterisk visible:

If(
    dropdown_input.Selected.Value = " ",
    true, false)

 

 

Super User
Super User

Re: Parent.error?

Nice! There IS a difference between blank and " ". Wow. 

 

Ok. So I got the asterisk to show now with the Visible formula set to: 

If(
    dropdown.seleced = " ", 
        true, false)

Now... Why when I click Submit, which executes SubmitForm(formname), does the form not error out? 

 

There are 14 cards set to Required, yet the form submits with blank values. 

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (6,054)