web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Conditionally make fie...
Power Apps
Unanswered

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
    152,855 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard