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 / Require data card valu...
Power Apps
Answered

Require data card value based on another field

(0) ShareShare
ReportReport
Posted on by 51

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. 

arshad2_0-1658892519790.pngarshad2_1-1658892554782.pngarshad2_2-1658892591670.png

 

Categories:
  • Akash17 Profile Picture
    Super User 2024 Season 1 on at

    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

  • arshad2 Profile Picture
    51 on at

    @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

  • Akash17 Profile Picture
    Super User 2024 Season 1 on at

    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

  • arshad2 Profile Picture
    51 on at

    @Akash,

    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.

  • Akash17 Profile Picture
    Super User 2024 Season 1 on at

    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

     

    Screenshot (14).png

  • arshad2 Profile Picture
    51 on at

    my issue is i have three input boxes within one data card:

    arshad2_0-1658899395872.pngarshad2_1-1658899454182.pngarshad2_2-1658899580246.png

    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 

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    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,

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 396 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 323

#3
WarrenBelz Profile Picture

WarrenBelz 193 Most Valuable Professional

Last 30 days Overall leaderboard