web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Validation for ComboBox
Power Apps
Answered

Validation for ComboBox

(0) ShareShare
ReportReport
Posted on by 141

I use ComboBox and set the Datacard is required to input.

But actually, this item can be omitted and submitted.

So when I go to see SharePoint list, they say error as this column is required (I attached the image).

So I want to set validation for this Datacard. How to write this?

 

I wrote value in "Update" property of the Datacard as the following.

 

If(!IsBlank(ComboBox1.Selected.Title),{Value: ComboBox1.Selected.Title})

 

This seems working properly, but once "else" case happens, after that, the form works unproperly.

I think I couldn't write code properly for "else" case. How to write "else" case for this case? I just don't want to submit the data,

when there is no data in ComboBox.  

 

image.png
Categories:
  • LRVinNC Profile Picture
    2,297 on at

    Set the Required property for the Data Card - not the combo Box - to true.  That way the user MUST make a selection in order to submit the form.

     

    A2.jpg

  • Kenjoy84 Profile Picture
    141 on at

    I did so. But for custom card, even I set required is true, it don't work.

    From SharePoint page, it knows this is the required column, so it shows error as my picture.

    But when the form is submitted, validation doesn't work properly for custom cards.

  • Verified answer
    LRVinNC Profile Picture
    2,297 on at

    Try using the following for the on select of your submit button:

    If(IsBlank(ComboBox1.SelectedItems.TestPerson), Notify("xxxx field is required", Error), SubmitForm(Form4))

     

    substituting the name of your combobox and the field it is connected to for the text in blue, providing a message of your choosing for the notify (green text) and your correct form (red)

     

     

  • Kenjoy84 Profile Picture
    141 on at

    Thank you for your additional comment!

    Actually, I don't use the submit button. Just use "save" function at Sharepoint.

    In such a case, how to fill in "Update" property of the Datacard. 

    I write "else" value as you mentioned(as attached picture), but it said error. Do you know the proper grammar for this case?

    image.png
  • LRVinNC Profile Picture
    2,297 on at

    Ah... it looks like then you are using "Customize form" in Sharepoint rather than creating a Canvas app.  My guidance was for doing this in  a Canvas app when it is very easily done.  Unfortunately, I do not use Customize form and cannot guide you further.  I do know only a subset of the full capabilities of PowerApps is available when customizing a form so it simply might not be possible but  others who use customize form may be able to confirm that or provide additional guidance.  Sorry.

  • Verified answer
    Kenjoy84 Profile Picture
    141 on at

    Thank you for your response.

    Somehow I found a  way for Custom form for Sharepoint.

    I am writing the way for others who stuck similar to me.

     If I write your code at "OnSave" property in Top "SharepointIntegration" class, it works.

    Thank you for your assist!

  • LRVinNC Profile Picture
    2,297 on at

    Good job!  I started to suggest that but wasn't sure it would work.  I am very glad you were able to figure out a solution.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 396 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 323

#3
WarrenBelz Profile Picture

WarrenBelz 193 Most Valuable Professional

Last 30 days Overall leaderboard