Skip to main content
Community site session details

Community site session details

Session Id : 1yNNuGvntEPV8UzjVhnpN5
Power Apps - Building Power Apps
Answered

How to set "Text" property of Label to actual Error message (instead of default Label.Text=Parent.Error) in CustomDataCard under custom DataCardValue

Like (0) ShareShare
ReportReport
Posted on 30 Mar 2021 21:01:33 by 195

I added a custom DataCardValue (say combobox) inside CustomDataCard and copied the original ErrorMessage under my DataCardValue
Snap 2021-03-31 at 01.54.09.png

 

I tried to set Text property with following but didn't work 

 

 

Errors('Issues Tracking',ThisItem.Priority)

 

 

 

Also I have 2 DataCardValue elements in my custom DataCard as shown in snap

 

How to show particular error message in label (only default error message after form is submitted). I only need to show the error message after form is submitted.... @Reza @RandyHayes @WarrenBelz @Drrickryp @Pstork1 @rubin_boer 

  • Pstork1 Profile Picture
    67,077 Most Valuable Professional on 01 Apr 2021 at 17:31:04
    Re: How to set "Text" property of Label to actual Error message (instead of default Label.Text=Parent.Error) in CustomDataCard under custom DataCardValue

    For that it would be better to use a data table rather than a label.  Then you can just set the items of the data table to the error()

  • amk1421 Profile Picture
    195 on 01 Apr 2021 at 17:28:24
    Re: How to set "Text" property of Label to actual Error message (instead of default Label.Text=Parent.Error) in CustomDataCard under custom DataCardValue

    @Pstork1 What if I need to show all messages newline separated?

  • amk1421 Profile Picture
    195 on 01 Apr 2021 at 16:42:39
    Re: How to set "Text" property of Label to actual Error message (instead of default Label.Text=Parent.Error) in CustomDataCard under custom DataCardValue

    @Pstork1 Hoping it works!

  • Verified answer
    Pstork1 Profile Picture
    67,077 Most Valuable Professional on 01 Apr 2021 at 16:39:20
    Re: How to set "Text" property of Label to actual Error message (instead of default Label.Text=Parent.Error) in CustomDataCard under custom DataCardValue

    Since it returns a table you may have to use First() to get the first record.

    if(First(Errors('Issues Tracking',ThisItem)).Column = "Priority",first(Errors('Issues Tracking',ThisItem)).Message)
  • amk1421 Profile Picture
    195 on 01 Apr 2021 at 16:35:40
    Re: How to set "Text" property of Label to actual Error message (instead of default Label.Text=Parent.Error) in CustomDataCard under custom DataCardValue

    @Pstork1 It gives error: "Expected text value"
    Tried using 

    If((Errors('Issues Tracking',ThisItem)).Column='Priority',Text((Errors('Issues Tracking',ThisItem)).Message))

    Now the error is "...function text has some invalid arguments"

    Also tried: 

    If((Errors('Issues Tracking',ThisItem)).Column=ThisItem.Priority,(Errors('Issues Tracking',ThisItem)).Message)

    "Expected text value"

  • Pstork1 Profile Picture
    67,077 Most Valuable Professional on 01 Apr 2021 at 16:19:29
    Re: How to set "Text" property of Label to actual Error message (instead of default Label.Text=Parent.Error) in CustomDataCard under custom DataCardValue

    The parameters for the errors() function are the data source and the record producing the error.  That returns a table of information.  So I think what you want is something like this

    if((Errors('Issues Tracking',ThisItem)).Column = "Priority",(Errors('Issues Tracking',ThisItem)).Message)
  • amk1421 Profile Picture
    195 on 01 Apr 2021 at 15:58:00
    Re: How to set "Text" property of Label to actual Error message (instead of default Label.Text=Parent.Error) in CustomDataCard under custom DataCardValue

    @v-xiaochen-msft I do not want to use custom error msg, only want to use "Parent.Error"

     

    Why would I use: If(!IsBlank(Parent.Error),"your particular error message")

     

    There is no point in checking if "Parent" is blank because parent, in my case, is a Custom Data Card containing two Data Card Values i.e. Priority & Save as Draft. I merely copied the error message Labels from original Data cards to my custom data card (which houses these 2 controls). Now my question is, How do I enable these custom labels to enact as the the original error message labels? Original label has property set as "Text = Parent.Error"

  • v-xiaochen-msft Profile Picture
    on 31 Mar 2021 at 02:35:02
    Re: How to set "Text" property of Label to actual Error message (instead of default Label.Text=Parent.Error) in CustomDataCard under custom DataCardValue

    Hi @akg1421 ,

     

    Please use this formula in the label control:

    If(!IsBlank(Parent.Error),"your particular error message")

    v-xiaochen-msft_0-1617157955707.png

    If you use the patch() function you could use the errors() function.

    So, if you use submitform() to submit data, please use my above formula.

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1