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

Make a field required based on another field

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!

1 ACCEPTED SOLUTION

Accepted Solutions
RusselThomas
Microsoft
Microsoft

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

 

View solution in original post

10 REPLIES 10
RusselThomas
Microsoft
Microsoft

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

 

View solution in original post

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!!

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".

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

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

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

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

Yea.. this works!

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

ty

 

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!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,297)