cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JS-JS
Helper I
Helper I

Powerapps - error message handling

Hi, how can i add error message with the condition below:

 

1) Upon clicking "+" icon,

  • If Person field did not selected, display error message (border color = red)
  • If Text Box field is blank, display error message (border color = red) Upon clicking Submit button,

2) Upon clicking Submit button,

  • If Data Table is blank (no record), display error message (border color = red)

JSJS_0-1668578775198.png

Thank you!!

1 REPLY 1
Anthony_Dob
Continued Contributor
Continued Contributor

@JS-JS 

On the + icon. Set the following formula:
If(!Isblank(Textinput.Text) And !IsBlank(comboBox.selectedItems), <Do your patch to datatable>;Set(varValidateAddInput,false),Set(varValidateAddInput,true))

Then on your text input controls bordercolor add the following formula If(Isblank(Self.Text) And varValidateAddInput,Red,Gray)

On comboBox/dropdown input controls add the following formula If(Isblank(Self.SelecectedItems) And varValidateAddInput,Red,Gray)

On your submit button you could just do. If(IsEmpty(<Datasource from datatable>),Set(varValidateSubmit,true),<Patch changes>;Set(varValidateSubmit,false))

on the error message beneath datatable set its visibility to:
varValidateSubmit

Do the same thing for the bordercolor of datatable as you did for input controls with varValidateSubmit variable
If this helped you resolved your answer please mark this answers as a solution.

Best Regards,

Anthony

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,047)