Skip to main content

Notifications

Copilot Studio - General
Unanswered

How to convert choice variable to string?

Posted on by 13
Hello Everyone.
 
I want it so that my Copilot, based on the user choice, then answers that choice using its knowledge file.
 
I add a Create Generative Answers step after my question step.
 
The question stores the user choice as a variable called user_menu_choice
 
If I try to add that choice variable as the input of the Generative Answers step it gives the error: 'Variable is being set to an incorrect type.   Assigned: EmbeddedOptionSet, expected: String'.
 
How do I convert the user choice value to String?

Many thanks.
  • Ian-Aware Profile Picture
    Ian-Aware 13 on at
    How to convert choice variable to string?
    Unfortunately, that didn't achieve what I wanted.
     
    I have a question that identifies an entity in the user response.
     
     
    How can I convert that to text as the entire user question and then pass it to the Generative Actions step (shown below) if the entity is not recognised?

    So basically, if the user asks a question not related to timesheets (not recognised by the entity) then I want it so that it captures that user question as a string and gives it to the 'Create Generative Answers' step to provide the answer instead.

    How do I do this?  I get an error right now.


    Many thanks.
  • Expiscornovus Profile Picture
    Expiscornovus 29,829 on at
    How to convert choice variable to string?
    Have you tried the Power Fx Text function for this?
     
    Below is an example
    Text(Topic.VarChoice)
     
     

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Community Update…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 140,585

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,336

Leaderboard