i have a data card which has three input boxes, based on the answer of another field they may vary which is define in the visible property. how can i set the on required property true for the visible field.
Solved! Go to Solution.
Hi @arshad2 ,
As per saying in the official doc:
https://docs.microsoft.com/en-us/power-apps/maker/canvas-apps/controls/control-card#key-properties
Required – Whether a card, editing the field of a data source, must contain a value.
When "Required" of the Card set to true, it means this Card need value other than blank for submission. The value comes from the controls within this Card and update to data source depends on the Update property. So, as per your scenario, you will need to use the Update property of this Card to determine what value need to be updated. In short words, Controls required or not depend on whether the value of them will be updated in the Card's Update property.
I'm not aware of how the visible of the Controls are performing, but basically you will need an If statement on Update of the Data Card to check the Visible of each control and determine whether the value of it is going to be updated to data source:
If(ddFor, ddFor.Selected.Result, nameInput.Visible, concatenate(nameInput.Text, ddID.Text))
Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
Hi @arshad2
I am assuming that you want to show or hide 'Transport request for' dropdown based on user type selected in the user type dropdown
in order to achieve this simply go to the 'Transport request for' dropdown on visible property of that 'Transport request for' dropdown apply If(DataCardValueOfUserTypeDropdown.Selected.Value="Employee",true,false)
so now in the dropdown if you select Employee only then this 'Transport request for' dropdown will be visible
If you have different scenario let me know
If you got your answer please accept as a solution and like
Thank you
@Akash17 ,
my visible property works fine, but i want to make the particular input field required based on the answer of the other field.
Please let me know if you dont understand!
thank you
Yes now I got your scenario
select your complete datacard of 'Transport request for' which you want to make it required there is one property called Required there you can apply if condition
DataCardValueOfUserTypeDropdown.selected.value="Employee"
for more please refer this link
https://www.youtube.com/watch?v=aVEaRpAlaTA&t=1s
go to 15th minute of video you will get your scenario
i have tried that but for my senario it is not working, can i define which input field is required using if condition. imagine i have 3 input field, if i select employee, the required field is combox1 and combox2. can i define the required field based on the data card value field.
Considering my scenario If user select product category as 'Electronics' and Is Discount as 'yes' then my discount field becomes mandatory and the If condition i have added on the required property of Discount card
This is my scenario just hoping this will help you and you can correlate it with your scenario
my issue is i have three input boxes within one data card:
i want to specifically make the type of field required based on the answer of the other field. for example: answer A of the other field should make the 2nd and 3rd field but the 1st field is not required.
thanks @Akash17
Hi @arshad2 ,
As per saying in the official doc:
https://docs.microsoft.com/en-us/power-apps/maker/canvas-apps/controls/control-card#key-properties
Required – Whether a card, editing the field of a data source, must contain a value.
When "Required" of the Card set to true, it means this Card need value other than blank for submission. The value comes from the controls within this Card and update to data source depends on the Update property. So, as per your scenario, you will need to use the Update property of this Card to determine what value need to be updated. In short words, Controls required or not depend on whether the value of them will be updated in the Card's Update property.
I'm not aware of how the visible of the Controls are performing, but basically you will need an If statement on Update of the Data Card to check the Visible of each control and determine whether the value of it is going to be updated to data source:
If(ddFor, ddFor.Selected.Result, nameInput.Visible, concatenate(nameInput.Text, ddID.Text))
Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.