Skip to main content

Notifications

Publish & Channel Management
Answered

Cannot Publish bot because of an error but chatbot works perfectly fine

Posted on by 28

Hello,

 

I have built a chatbot which has set of question to get input from user and based on those input it runs a flow through power automate to create an item into SharePoint list. I tested chatbot and it works fine but when I try to publish chatbot, below error is throwing: 

variable is being set to incorrect type Assigned embedded optionset expected embedded optionset.

Sharmilshah_0-1705058667025.png


In above snapshot step, bot stores the variable into global variable which is being used by Power automate flow from a different topic. In power automate flow, I converted this choice to text variable. Anyone please help me how to fix this error and get the bot published?

 

Thanks

  • Sharmilshah Profile Picture
    Sharmilshah 28 on at
    Re: Cannot Publish bot because of an error but chatbot works perfectly fine

    Thanks @remidyon for looking into this and helping me to get the solution. Issue is resolved.

  • Verified answer
    remidyon Profile Picture
    remidyon on at
    Re: Cannot Publish bot because of an error but chatbot works perfectly fine

    Hello @Sharmilshah 

     

    I was able to replicate your issue: when you create the multiple-choice option in your question as an open list of string it creates a type of choice in the back with a particular list of values, this type of choice is then transmitted to your global variable when you set it later in your first topic. When you create your second topic and try to assign another type of choice to the same global variable the editor refuses because the list of choice does not match (the 2 list contains different options).

     

    The solution is quite simple: you need to create an entity (type closed list) with all the potential options from your topics and only use the options you need in each topic (you can select the options in your question). Once you do that the type of choice will be common to all your topics and you will be able to assign the Global variable without an issue (I tested it on my side and it works fine).

     

    Closed list Entity:

    remidyon_1-1705673799521.png

     

    Topic 1 with 2 choices

    remidyon_0-1705673770883.png

     

    Topic 2 with 2 different choices (but still from the same entity):

    remidyon_2-1705673833635.png

     

    No problem to assign to the global variable since it is now the same type of choice

    remidyon_3-1705673859960.png

     

    Hope that helps!

     

  • remidyon Profile Picture
    remidyon on at
    Re: Cannot Publish bot because of an error but chatbot works perfectly fine

    @Sharmilshah sorry I have not had the time to look at your issue - I will try to give you a feedback asap

  • Sharmilshah Profile Picture
    Sharmilshah 28 on at
    Re: Cannot Publish bot because of an error but chatbot works perfectly fine

    @remidyon Did you get a chance to look into the issue and YAML code I sent in earlier message?

  • Sharmilshah Profile Picture
    Sharmilshah 28 on at
    Re: Cannot Publish bot because of an error but chatbot works perfectly fine

    Thank you @remidyon  for looking into this. I have 2 YAML where in 1 it works but in other it doesn't. I tried to copy paste the code here but it doesn't show when I refresh the page. So attaching as word document. First code works but second code in another topic throws an error.

  • remidyon Profile Picture
    remidyon on at
    Re: Cannot Publish bot because of an error but chatbot works perfectly fine

    Hi @Sharmilshah 

    Could you share the YAML of your topic (by opening the code editor and copy-pasting the YAML?). I am unable to reproduce this issue: I have no problem assigning a choice variable to another choice variable (even using a closed list entity)

Helpful resources

Quick Links

Welcome to the Power Platform…

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

Getting Started…

Welcome to the Power Platform Community! We appreciate your visit…

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 138,287

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,172

Leaderboard

Featured topics