cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Microsoft
Microsoft

Re: Make a field required based on another field

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

8 REPLIES 8
Highlighted
Microsoft
Microsoft

Re: Make a field required based on another field

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

Highlighted
Helper I
Helper I

Re: Make a field required based on another field

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

Highlighted
Helper IV
Helper IV

Re: Make a field required based on aI'nother field

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

Highlighted
Microsoft
Microsoft

Re: Make a field required based on aI'nother field

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

Highlighted
Helper IV
Helper IV

Re: Make a field required based on aI'nother field

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

Highlighted
Helper IV
Helper IV

Re: Make a field required based on aI'nother field

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

Highlighted
Microsoft
Microsoft

Re: Make a field required based on aI'nother 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

Highlighted
Helper IV
Helper IV

Re: Make a field required based on aI'nother field

Yea.. this works!

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

ty

 

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (10,196)