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 / Programming Power Apps...
Power Apps
Answered

Programming Power Apps property "Required" with multiple selection

(0) ShareShare
ReportReport
Posted on by 15

Hello, I have a problem in Power Apps for which I unfortunately can not find a suitable answer:

 

This is about setting a mandatory field if a certain value or several specific values are set in a multiple selection.

I have programmed the "Required" property in such a way that the respective field must be filled in mandatorily if a certain value has been selected in another field that allows multiple selection.

 

Example: Field Hyundai: (Required=Automarke.Selected.Value="Hyundai") and Field Ford: (Required=Automarke.Selected.Value="Ford") . This works as long as only a single value is selected in the multiple selection under "Automarke". If several values are selected in the multiple selection under "Automarke", all values mentioned (Hyundai and Ford) should actually be set as mandaroty, but unfortunately only the last one mentioned (Ford) is set as mandatory.

 

Example see screenshot:

If I select both "Hyundai" and "Ford" as "Automarke" by multiple selection, both fields should be set below as mandatory fields. Currently, only the last selected field (Ford) is set as a mandatory field.

 

I am thankful for any help.

 

Thanks in advance.

Power Apps Problem.jpg
Categories:
I have the same question (0)
  • Verified answer
    Akser Profile Picture
    1,546 Moderator on at

    Hi @Janine147,

     

    Can you try the following condition? 

    "Hyundai" exactin Automarke.SelectedItems.Value

     

  • Janine147 Profile Picture
    15 on at

    Awesome, it works! Thank you so much!

  • Janine147 Profile Picture
    15 on at

    @Akser: Hello Akser, I'm sorry to have to revoke my answer from earlier, but unfortunately it doesn't work. Do you have any other idea how to solve the problem?

  • Akser Profile Picture
    1,546 Moderator on at

    @Janine147, can you share the error message screenshot please?

  • Janine147 Profile Picture
    15 on at

    Hi @Akser : Unfortunately there is no error message.

     

    The problem is the same as I mentioned above: When I select the second "Automarke", the mandatory condition for the first one disappears and only the second one is set as a mandatory field.

     

    In my opinion the problem is in Automarke.Selected.Value. I think it will be "overwritten" by choosing the second Automarke and therefore turns false for the first one. Is there an opportunity to set a field as always "true" when it was true once?

  • Akser Profile Picture
    1,546 Moderator on at

    Hi @Janine147,

     

    You are right that Automarke.Selected.Value will show the last selected value which is why I suggested Automarke.SelectedItems.Value. We are basically saying that if "Hyundai" is among the selected items, then execute the formula. 

     

    Alternatively you can replace the combo box with a gallery. When the user clicks a row in that gallery, add it to a collection (or remove it if it exists):

    If(ThisItem in colSelectedAutomarke, Remove(colSelectedAutomarke, ThisItem), Collect(colSelectedAutomarke, ThisItem))
    

     And adjust your required formula to 

    "Hyundai" exactin colSelectedAutomarke.Value

     

  • Janine147 Profile Picture
    15 on at

    @Akser Oh dear, that was my mistake, I am pretty sorry. I overlooked Automarke.SelectedItems.Value. Now it works perferctly, thanks a lot 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 491

#2
WarrenBelz Profile Picture

WarrenBelz 407 Most Valuable Professional

#3
11manish Profile Picture

11manish 331

Last 30 days Overall leaderboard