SMCthat
SMCthat

Reputation: 1

Copilot Studio - how can I save/convert a choice Variable as/to a string?

What I'm doing:

I'm currently trying to create a chatbot in Copilot Studio for internal Orders. User can select which Product they want to buy.

What I want:

The copilot should give a list of options in a Question "Which one..?". The Chosen one (by the User) should be send to a PowerAutomate flow.

What's my Problem:

The Selection from User is saved as a "choice" instead of a "string". And my PowerAutomate Flow want a string so I get an "BindingIncorrectTypeError". Unfortunately theres no Option "Save Choice as String" or "Convert to String" BindingIncorrectTypeError

The only solution which worked so far:

for each Option, create a if condition. There set a string Variable "KeyboardChoiceUser" with the Value. But then the flow has hardcoded parts and I cannot simply change the OptionsEmbeddedList. MySolution

My Question:

Is there a option I didn't see? If not, is there a better way than mine?

Upvotes: 0

Views: 1488

Answers (1)

MartinS
MartinS

Reputation: 11

I was dealing with the same issue and this solution worked:

https://community.powerplatform.com/forums/thread/details/?threadid=d13e0357-9548-ef11-a317-6045bdf0923f

In Text(Topic.VarChoice), replace "Topic." with "Global." if your topic is set as Global, and replace "VarChoice" with a name of your variable.

Read more about using Power Fx to set a variable: https://learn.microsoft.com/en-us/microsoft-copilot-studio/advanced-power-fx#use-power-fx-to-set-a-variable

Upvotes: 1

Related Questions