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 / Copilot Studio / How can I reference ch...
Copilot Studio
Answered

How can I reference choice variables using Power fx?

(0) ShareShare
ReportReport
Posted on by 10

I have a bot topic that at some point, needs to set a variable based on a choice the user has made in a previous part of the flow.

 

The problem is, the Choice field is not recognised as a same comparable type as Text, so my formula isn't working. I've had this issue before using Power fx with Power Apps, and I know that there is a way to reference the choice itself, rather than a text value, but there appears to be no "Choices" function built into the PVA side of things. Does anyone know how I reference the Choice correctly?

 

Here's a sample of the code not working below:

 

 

If(Topic.selectedColor = "Blue", true, false)

 

 

 

The error I'm receiving is:

Incompatible types for comparison. These types can't be compared: OptionSetValue(cr559_bot.topic.colorpickerflow.main.question_Ckz917), Text

 

Thanks

Categories:
I have the same question (0)
  • Verified answer
    HenryJammes Profile Picture
    Microsoft Employee on at

    Can you try by changing the format of your variable to text?

     

    If(Text(Topic.selectedColor) = "Blue", true, false)

     

    Also, not sure if it helps, but I had explored dynamic options in that post, and I manipulated these in Power Fx too:

    Solved: Re: How can I use Dynamic Multi-choices in the PVA... - Power Platform Community (microsoft.com) 

  • benshikari Profile Picture
    10 on at

    Fantastic, thanks @HenryJammes - I'm not sure why I didn't even think about casting as Text but I'm glad it works and you pointed it out! Thanks again.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 370

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 184 Super User 2026 Season 1

#3
chiaraalina Profile Picture

chiaraalina 57 Super User 2026 Season 1

Last 30 days Overall leaderboard