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

Community site session details

Session Id : yX0RWJBwl+fT3co4ZPrEKm
Power Apps - Building Power Apps
Unanswered

How do I make a second text field within a datacard required or fix the required code on the primary combobox?

Like (0) ShareShare
ReportReport
Posted on 1 Apr 2021 18:44:34 by 634

Future_Vision_0-1617301956333.png

 

Above is what I am working with. If the Source combobox includes '3rd' then the datacard below it shows. That datacard also becomes required using this code.

 

If("3rd" in Source_CB.Selected.'Source (cr9c7_name)', true, false)

 

Now, if  the "** Add a 3rd Party **" option is selected the "Add 3rd Party" text box appears. You enter a value and click "Add" and the new value is populated in the 3rd Party combobox. That all works great except when I come to validation. First, if you choose a "Source" and don't do anything to account for the "** Add a 3rd Party **" option the form validates and is submitted with the 3rd party being "** Add a 3rd Party **". I don't want that to happen. What I was originally thinking was that there was some logic that if "Source" contained '3rd' AND the "3rd Party" combobox had a value of  "** Add a 3rd Party **" then the form would not validate. I couldn't get that to work. I tried something like this:

 

 

If("3rd" in Source_CB.Selected.'Source (cr9c7_name)' && '3rdParty_CB'.Selected.'Third Party (cr9c7_thirdparty)' = "** Add 3rd Party **", true, false)

 

 

Then I was thinking what if I can make the "Add 3rd Party" text box required when "** Add a 3rd Party **" is selected that might be the answer to this form validation issue. No such luck putting required on that second text box within a datacard.

 

I'm sure I am overlooking something simple here. Ultimately, I want to make the form invalid if the text in the "3rd Party" combobox is "** Add 3rd Party **"

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on 01 Apr 2021 at 19:44:02
    Re: How do I make a second text field within a datacard required or fix the required code on the primary combobox?

    @Future_Vision 

    To really understand how a form works, you only need to know two things.  First, the default property of the control inside the card and second, the Update property of the card.  Everything else in the card is pretty much superfluous. 

    The Default property of the control is usually set according to the Parent.Default for the field of the card.   

    The Update property of the card determines what value is saved for that field. If you are saving some combination of values from controls in the card, this is where you would write the formula for that. 

  • Future_Vision Profile Picture
    634 on 01 Apr 2021 at 19:56:15
    Re: How do I make a second text field within a datacard required or fix the required code on the primary combobox?

    @Drrickryp I'm not sure I completely follow. 'Source' is it's own card and "3rd Party" is its own card. I just need the form to be unsubmittable if "Source" contains "3rd" AND "** Add a 3rd Party **" is selected for "3rd Party"

  • Future_Vision Profile Picture
    634 on 01 Apr 2021 at 20:08:02
    Re: How do I make a second text field within a datacard required or fix the required code on the primary combobox?

    Just to be clear. The "Add 3rd Party" field only patches a new value to the dataset and adds the value to a variable when "Add" is clicked. The "3rd Party" combobox refreshes with this new variable value selected. So this brings me back to the form being valid and ready for submission only if the value in the "3rd Party" field is not blank or contains "** Add 3rd Party **".

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Tom Macfarlan – Community Spotlight

We are honored to recognize Tom Macfarlan as our Community Spotlight for October…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 752 Most Valuable Professional

#2
developerAJ Profile Picture

developerAJ 472

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 358 Super User 2025 Season 2

Last 30 days Overall leaderboard
Loading complete