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 / Comparing a record/Opt...
Power Apps
Unanswered

Comparing a record/OptionSet to text

(0) ShareShare
ReportReport
Posted on by 5

Hi, I am currently testing my power app in the test studio and I am trying to test that when the submit button on my app is pressed, the report status in my table in dataverse has changed from blank to 'Draft'. I have currently written at the end of my test:

Assert('Report Status' = "Draft")
However, this does not work as you can not compare a OptionSet to Text. I also only need to check the value for the particular record I am submitting- which I am stuck on how to do. How would I go about asserting the value of 'Report Status' column is equal to "Draft" for the row for the particular record?
Categories:
I have the same question (0)
  • AhmedSalih Profile Picture
    6,680 Moderator on at

    @Ell-rose ,  In Dataverse, to compare the Column value which is a Choice to the Choice value:

     

    ColumnName=OptionSetName.Draft   >> Note, Draft has to be one of the OptionSet Items.

     

     

  • Ell-rose Profile Picture
    5 on at

    Hi, thank you for your reply

    I have written this in my assert:

     

    Assert('Report Status'='Report Status'.Draft)

     

    However I get this error:

     

    Incompatible types for comparison. These types can't be compared: OptionSet(Report Status), OptionSetValue(Report Status).

     

    Am I typing this wrong? The column name is Report Status and the choice is called Report Status aswell. Draft is one of the optionSet items.

     

    Also, Is there anyway I will be able to specify which row of the table this is checking from - as that is crucial for my testing. 

  • AhmedSalih Profile Picture
    6,680 Moderator on at

    @Ell-rose, It is because you are using it inside assert function. Also, there are some limitations for the Test Studio that you need to be aware of, Check this out: (I recommend that you test in PowerApps-Canvas App)

    https://docs.microsoft.com/en-us/power-apps/maker/canvas-apps/test-studio#known-limitations

     

    To answer you second question (this will also show example of where the formula will work), you can filter a table based on a value of an choice column:

     

    Example:

    I am using a Gallery, and in its Items Property:

    Filter(TableName, ColumnName=ChoiceName.Value)

    If I use this with your table, the Gallery will only show records of a Draft Status:

    Filter(TableName, 'Report Status'='Report Status'.Draft)

     

  • AhmedSalih Profile Picture
    6,680 Moderator on at

    @Ell-rose, Also, if you will use EditForm to create new records, add the ChoiceColumn Field to the form and set the Update Property of that field DataCard to 'Report Status'.Draft.

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 392

#2
WarrenBelz Profile Picture

WarrenBelz 364 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 271 Super User 2026 Season 1

Last 30 days Overall leaderboard