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 :
Copilot Studio
Unanswered

condition

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

hii sir

how to looping previous question with variable output

example

i have variable (number) 

in that variable i have "5" in that output

so i want 5 times looping that question

Categories:
I have the same question (0)
  • MattJimison Profile Picture
    579 Most Valuable Professional on at

    Hi, @Anonymous . Can you try and elaborate on your request? I'm not sure I'm understanding what you're asking for. Are you saying that you'd have a question where you ask the user to enter a number, and then after that, you want to ask another question as many times as the number they entered?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    yes sir

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    hii @MattJimison yes 

  • MattJimison Profile Picture
    579 Most Valuable Professional on at

    Is the bot built in the original PVA interface or the new unified canvas?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    hello @MattJimison unified canvas

    and 

    i have another issueScreenshot 2023-05-17 at 6.04.36 PM.png

    why stars are came i cant understand

  • MattJimison Profile Picture
    579 Most Valuable Professional on at

    Hi, @Anonymous . I'm not sure what you mean by "why stars are came?"

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    when i use "Go to step" opition, i am shared one screenshot in below stars are coming 

    see in red  rectangular box

  • inzil2k Profile Picture
    190 on at

    If you add Bold styling to your text, that's how it appears in the 'Go to step' node.

  • MattJimison Profile Picture
    579 Most Valuable Professional on at

    @inzil2k is correct, and the reason it's doing it is it's just showing you the markdown format of the text inside the node you are redirecting to. As an example, if you had a question that was bolded and italicized, the "Go to step" option will show the asterisks and the underline. Your end users won't ever see the text like this, so it shouldn't cause an issue.

     

    MattJimison_0-1684787818915.png


    Find this post helpful? Please mark it as the solution and/or provide kudos so that it will help others in the future.

    Cheers,
    Matt

  • MattJimison Profile Picture
    579 Most Valuable Professional on at

    @Anonymous  you can copy/paste the below code into a new topic in the Unified Canvas and it does what you requested. You do this by clicking on the "..." in the top-right corner of the topic and choosing "Open code editor" and pasting in the code.

    MattJimison_1-1684789257908.png

     



    A few notes on how it works:

     

    1. It only asks the user to enter a number once and skips the question afterwards (default behavior of a question node). This allows us to redirect to this node but not have the question asked again (you can't "Go to" a condition node so this is why you have to point back to the question to get the condition to reevaluate again and determine whether it needs to run again)

    2. It is set to always ask the question in the condition loop which we're using like a 'for' loop (I have it asking for Movie #x in the question). In a real world scenario I'd make sure this number isn't too high - not sure what your use case is but you wouldn't want to have someone enter 1,000 and then repeatedly ask the question.

     

    kind: AdaptiveDialog
    beginDialog:
     kind: OnRecognizedIntent
     id: main
     intent:
     displayName: Counter
     triggerQueries:
     - counter
    
     actions:
     - kind: SetVariable
     id: XRw8vq
     variable: Topic.Counter
     value: 0
    
     - kind: Question
     id: Question_VGvhH2
     variable: Topic.NumberToRepeat
     prompt: Enter a number.
     entity: NumberPrebuiltEntity
    
     - kind: ConditionGroup
     id: conditionGroup_GhGRvA
     conditions:
     - id: conditionItem_b1d4Dm
     condition: =Topic.Counter < Topic.NumberToRepeat
     actions:
     - kind: SetVariable
     id: setVariable_xSUoUq
     variable: Topic.Counter
     value: =Topic.Counter+1
    
     - kind: Question
     id: question_KtDima
     interruptionPolicy:
     allowInterruption: true
    
     alwaysPrompt: true
     variable: init:Topic.Var1
     prompt: "Movie #{Topic.Counter}"
     entity: StringPrebuiltEntity
     alwaysAsk: true
    
     - kind: GotoAction
     id: L1TAGm
     actionId: Question_VGvhH2
    
     - kind: SendActivity
     id: sendActivity_bBxaVN
     activity: Finished loop.
    
    inputType: {}
    outputType: {}

     

     


    Find this post helpful? Please mark it as the solution and/or provide kudos so that it will help others in the future.

    Cheers,
    Matt

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 567

#2
Haque Profile Picture

Haque 143

#2
chiaraalina Profile Picture

chiaraalina 143 Super User 2026 Season 1

Last 30 days Overall leaderboard