cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SANJURK
Helper II
Helper II

Make a column mandatory based on value of another column

Hi,

 

Make a column mandatory based on value of another column/ Data card value mandatory depending on the value of another column

 

 

I have a data that is being used to collect data by the field technician.

I have a sharepoint list, with the data and some of which columns are mandatory.

I have been trying to build an app, to make data received has all data recorded.

 

I have a column with data that says -  "Truck", if the data in the column is a "Truck", then I want to make sure that the data in more than two to three columns are mandatory and shouldnt be blank.

 

I do know that the the required property can be changed to true, but how will I make this false or true depending on the dropdown data - Truck or Car

 

Just an example :

 

Scenario 1

My column - Vehicle Type - "Truck"

 

Column 1 - Load - This column is made mandatory

Column 2 - Wheels - This column is made mandatory

 

Scenario 1

My column - Vehicle Type - "Car"

 

Column 1 - Load - This column is not mandatory

Column 2 - Wheels - This column is not mandatory

 

Above is just an example - I have almost 20 to 30 such columns that need to be made mandatory according to the selection.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@SANJURK 

In the Required property for the Column1 and Column2 DataCard, set the formula to:

   dataCardValueForVehicleType.Text = "Truck"

 

This assumes that the Vehicle Type is a text control.  

 

Also, you cannot override a required column in PowerApps by changing the required property.  If the datasource has a column listed as required, then it will be required to submit your form.  So, I would make sure that both columns you are interested in have required set to false in the datasource.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@SANJURK 

In the Required property for the Column1 and Column2 DataCard, set the formula to:

   dataCardValueForVehicleType.Text = "Truck"

 

This assumes that the Vehicle Type is a text control.  

 

Also, you cannot override a required column in PowerApps by changing the required property.  If the datasource has a column listed as required, then it will be required to submit your form.  So, I would make sure that both columns you are interested in have required set to false in the datasource.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

SANJURK
Helper II
Helper II

@RandyHayes- Thanks, that worked.

 

Sorry for asking another question here - Once the data card is made "required" and what if the I dont want people to enter the value 0 for the datacard that has been made mandatory.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

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.

Users online (1,718)