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 / Make a field required ...
Power Apps
Answered

Make a field required based on another field

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I am trying to make a field required based on another field and not having any success.

 

Formula that does not work:

If('Is this PO for a Vendor or Subcontractor?'.Selected.Value = "Vendor",true,false)

 

Is this PO for a Vendor or Subcontractor?: the data card of previous field

Vendor: the selection of the data card identified above.

 

Please help!

Categories:
I have the same question (0)
  • Verified answer
    RusselThomas Profile Picture
    4,014 on at

    Hi @DCI_18 ,

    Should work....my guess is you're targeting the card instead of the dropdown.

    Try simplify to debug;

    • If the card Name is "Is this PO for a Vendor or Subcontractor?" - try change it to something simpler like "POVendorCard" and rather change the DisplayName:  property of the card to something like "Is this PO for a Vendor or Subcontractor?".
    • Also, check the name of the actual dropdown control - this should be DataCardValue_something.  To be sure, you can rename this to something like "POvendorDropDown".

    Then try set the Required: property of the current Card based on the dropdown Control of the previous card - so something along the lines of;

    Required:

    POvendorDropDown.Selected.Value="Vendor"

    The Required field is a boolean, so you don't need to use an If(logical test, true, false) function - you can just put a comparison statment in there and if it's true, the output will be true.

    Hope this helps,

    RT

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you so much @RusselThomas ! I simplifed the data card and then labeled the drop down list a unique value and the formula was successful!!

  • dmclaughlin Profile Picture
    349 on at

    I'm still having issues with this.  I have a field called export.  I want the next field called taxid to be required if Export = "Yes".

  • RusselThomas Profile Picture
    4,014 on at

    Hi @dmclaughlin,

    Can you be more specific about the issue in terms of errors or the behaviour you're experiencing?

    Some screenshots might help too.

    Kind regards,

    RT

  • dmclaughlin Profile Picture
    349 on at

    I've attached a word document with info on the field I'm having issues with

  • dmclaughlin Profile Picture
    349 on at

    I've tried several more If statements in the required advanced area of the field I want required based on another field

  • RusselThomas Profile Picture
    4,014 on at

    Hi @dmclaughlin ,

    DatacardValue24 refers to the control - you need to refer to a property of that control - in this case, its selected value.

    In your doc, the control is a dropdown, which means your expression on the taxid card Required: property should be as follows (as is, no need to wrap it in an If() statement)

    DatacardValue24.Selected.Value="Yes"

    If you really want to make it more obvious to the user, you can also set the Visible: property of the taxid card to the same.  Then it will pop up as soon as the user selects "Yes" in the Export dropdown. 

    Hope this helps,

    RT

  • dmclaughlin Profile Picture
    349 on at

    Yea.. this works!

    If(datacardvalue24.selected.value = "Yes",true, false)

    ty

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    hi, I am having similar issue - I need to make an attachments field required if "Project work for OS/Run Service" or "One Off Project Work" are selected from the dropdown menu of this field "Revenue Bucket". Id there a way I can do that? Thanks!

  • jaxapmi Profile Picture
    28 on at

    Hello @RusselThomas !

     

    The above property (comparison statement) worked beautifully for one value, for my app.

     

    How can I have the property look for one of two values to make the other field required?

     

    My example is

    • IF "Beareavement" OR "Other" is selected
    • THEN make the field required

    Thank you, in advance, for your guidance on this.

    Jax

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard