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

Conditional Requirement based on Gallery Value/Form Viewer

(0) ShareShare
ReportReport
Posted on by 52

Hello, 

 

I have a page in which an approver can see the individual's entry on a gallery/form viewer. They have an accept or decline and a comments field. Based on one of the fields in the form viewer, I would like the comments field to be required. The type the Datacardvalue 16_1 is a combo box. 

 

I have tried several variations of 

If((DataCardValue16_1.SelectedItems= "Convenience", true, false))

If((DataCardValue16_1.Text= "Convenience", true, false))

If((DataCardValue16_1.Selected.Value= "Convenience", true, false))

 

 

I can't seem to get it down to having no errors. I keep running into an incompatible types for comparison error. Any ideas? Thinking it must be the format of the .select .text, etc. As I have several other If statements in the app but when referring to the info in the form viewer, it isn't seeming to work. Any help is appreciated!!

Categories:
I have the same question (0)
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @kayakingaway,

     

    Could you try the following code in the Required property of the Comments DataCard:

     

    DataCardValue16_1.Selected.Value = "Convenience"

     

    You can get the selected Choice by using comboboxName.Selected. If you want to compare it to text, you will have to add .Value at the end as well. An if statement in this case is not needed since the code above will have true or false as an output. However, If() statements only require 1 pair of brackets - your last if statement was the correct one (combobox value wise) and should look as follows:

     

    If(DataCardValue16_1.Selected.Value = "Convenience", true, false)

     

    As said, if statements that have true or false as a response are redundant and can be left out.

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

     

  • kayakingaway Profile Picture
    52 on at

    Thank you, thank you! This worked Perfectly.

     

    DataCardValue16_1.Selected.Value = "Convenience"

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard