
Announcements
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?
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