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 Automate
Unanswered

randomize questions

(0) ShareShare
ReportReport
Posted on by

Hi, I'm a beginner and I need help with an automation using Power Automate Desktop.

 

Basically I have a base of 5 questions in Excel and I need to randomize them, select 3 and send them to a Word document.

 

I was able to read the questions and randomize them, but I couldn't select just 3 and save them in Word.


Below I share the base with the questions, it is in Portuguese:

Base 

 

I thank you for your attention!

I have the same question (0)
  • Jamar_Forsythe Profile Picture
    Microsoft Employee on at

    You may want to use a Loop with a condition that does something like write %ExcelDataTable[RowNumber][0]% where the value of %RowNumber% increases by 1 after each loop until it gets to 3.

    Here are some helpful links:

    Loops - Power Automate | Microsoft Learn
    Variable data types - Power Automate | Microsoft Learn
    Variable manipulation and the % notation - Power Automate | Microsoft Learn

  • VJR Profile Picture
    7,635 on at

    If you have total 7 questions as an example, then the below action will give you any 3 numbers from 1 to 7.

    If "Allow duplicates" is false it will give 3 different numbers which is what you will need.

     

    VJR_0-1666850538312.png

     

     

    Map these 3 numbers such that they correspond to the row numbers of Excel (Consider row headers etc).

    Eg; If 1, 5, 7 are the three randomly generated numbers,

    Then pick the question from Excel rows 1, 5 and 7.

     

    If your 1st random number is 1 then the below will read the Excel value of cell A1 where 1 will be your variable.

     

    VJR_1-1666850898536.png

     

     

     

    On searching you will get code to write to a word document using Vbscript.

    Then use "Run vbscript" action and write those questions to a Word file.

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 785

#2
Valantis Profile Picture

Valantis 669

#3
Haque Profile Picture

Haque 563

Last 30 days Overall leaderboard