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 / Setting a required fie...
Power Apps
Unanswered

Setting a required field when clicking on checkbox item (from multi choice data)

(0) ShareShare
ReportReport
Posted on by 12

Hi,

 

I'm trying to set a Text field on my form control as NOT required if a specific item is clicked in a checkbox which is a control for a multi choice column in a sharepoint list.

 

I would like the field PT/OTM Number to become NOT required if the 'New Train' box is clicked - currently I've had to set the whole field as NOT required at all.

 

AndyB1308_0-1708717482928.png

Any help on this would be appriciated

 

Andy

Categories:
I have the same question (0)
  • Cat Schneider Profile Picture
    488 Most Valuable Professional on at

    It sort of depends on how you have the Change Type control set up... Is it all a bunch of individual checkboxes? Is it a gallery with a table of values for the items property, and there's a checkbox to display the text of ThisItem.Value?

    How does the 'New Train' checkbox come to exist? You should be able to use: 

    Checkbox.Value <> true

    in the required property for the field you want to update.

    Let me know if it's a gallery with a checkbox in it, and I can help you get the value to use instead; or if you have this set up some entirely different way.

  • AndyB1308 Profile Picture
    12 on at

    Hi,  it’s setup as a gallery with a table not individual checkboxes.  The source is a multi choice column in a sharepoint list.

  • Cat Schneider Profile Picture
    488 Most Valuable Professional on at

    Use the following in the Required Property of your field to set the value based on the Checkbox being selected:

    First(
     Filter(
     //Replace GalleryName (below) with the name of your gallery control
     GalleryName.AllItems,
    
     //Replace Fieldname (below) with the name of the Field being used to populate the text of the checkbox
     Fieldname = "New Train"
     )
    //Replace Checkboxname (below) with the name of the Checkbox control being used in your gallery 
    ).Checkboxname.Value <> true


    This should work to get the value of the specific checkbox you want to access.

  • AndyB1308 Profile Picture
    12 on at

    Thanks,

     

    This is what I have, but it's showing an error as the data types aren't the same?  Sorry I'm still learning.

     

    First(
    Filter(
    //
    Gallery1.AllItems,

    //
    ChangeType_DataCard3 = "New Train"
    )
    //
    ).Checkbox1.Value <> true

  • Verified answer
    Cat Schneider Profile Picture
    488 Most Valuable Professional on at

    So, you are getting an error because you are trying to call the DataCard as a Fieldname for the Gallery Items. You need to use the name of the field that contains the values "New Train", "Add Loco", "PAP/PDP", etc. 

    Easiest was to figure out what that field name is would be to select Checkbox1, and check the "Text" Property value. It most likely says something like: 

    ThisItem.Value

    If so, replace ChangeType_DataCard3 in what you have above with the whole bit that comes after:

    ThisItem.

    Meaning if the Text property of Checkbox1 is indeed

    ThisItem.Value

    then you should have the use the following for the Required Property:

    First(
     Filter(
     Gallery1.AllItems,
     Value = "New Train"
     )
    ).Checkbox1.Value <> true

     
    If it is not 'Value', and you are still having some trouble, would you post a screenshot showing what you have entered in for the Items property of Gallery1?

  • AndyB1308 Profile Picture
    12 on at

    Hi?

     

    That worked great.  Thanks for your help 👍🏻

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard