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 / Conditionally make fie...
Power Apps
Answered

Conditionally make fields required

(0) ShareShare
ReportReport
Posted on by

I have two fields in a PowerApp form that conditionally make each other required based on their values. One field is "Number of interactions" and the other is "Cost of Interactions". What I would like to happen is if the Number of Interactions is >0 (I have a Coalesce statement on the datacard's Update property to make sure they don't space out the text), then the Cost of Interactions field is required, and must have a value >0. It that condition doesn't exist, then I want an error message to appear and not allow a successful form submission. In addition, I want a required column to stop form submission.

Likewise, if the Cost of Interactions > 0 (I also have a Coalesce statement on this datacard's Update property to make sure they don't space out the text), then the Number of Interactions field is required and must have a value >0. If that condition doesn't exist, then I want an error message to appear and not allow a successful form submission. In addition, I want a required column to stop form submission.

I have placed with each datacard's Required property, but obviously am missing something because it is allowing me (successful form submission) to put an amount in with 0 interactions and add 10 interactions with a zero amount.

Any suggestions?

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    154,452 Most Valuable Professional on at

    Hi @AnnetteM ,

    In the Required property of each Data Card (use your control names) 'Cost of Interactions'

    Value(InteractionsNumberBox.Text) > 0

    and in 'Number of Interactions'

    Value(InteractionsCostBox.Text) > 0

    As an additional check

    If(
     FormName.Valid,
     SubmitForm(FormName),
     Notify( . . . . )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 542 Most Valuable Professional

#2
Haque Profile Picture

Haque 206

#3
Kalathiya Profile Picture

Kalathiya 201 Super User 2026 Season 1

Last 30 days Overall leaderboard