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 Platform Community / Forums / Power Automate / set multiple variable ...
Power Automate
Answered

set multiple variable from Single selection from

(0) ShareShare
ReportReport
Posted on by 25

Hi Community

 

I am setting up a monthly RPA flow, including creating files, pasting into excels, saving files into different folders, by Month. 

 

I want to use a pop-up dialog (after user Clicked Run the RPA) to select the period (202401, 202402 or etc)the file is run for.  After the user's input, the 3 variables will be set up automatically matching the selections (Below table, like an excel Vlookup on Col A, for Col B, C, D).

VIncent_AZK_0-1718869643300.png

 

How do I do to set the three yellow variables by clicking the 202401, 202402 list? 

 

 

I am pretty new to RPA and have no programming experience. I currently do this manually (without a dialog) by "Set variable" three times manually. 

 

Appreciate your help!

I have the same question (0)
  • Deenuji_Loganathan_ Profile Picture
    6,255 Moderator on at

    @VIncent_AZK 

     

    You can use "Display input dialog" or "Display select date dialog(if need to select any date as input)" to get your input from runtime and save into different variables and perform the above mentioned process.

     

    Deenuji_0-1718873133220.png

     

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

  • VIncent_AZK Profile Picture
    25 on at

    I want to only enter input once, i.e. 202401 and then be able to trigger the automate creation of the three variables for the corresponding period.  

     

    I am currently creating the variables one by one but it is not sufficient, because the user of the flow will only want to enter the period, not the three variables. 

  • Deenuji_Loganathan_ Profile Picture
    6,255 Moderator on at

    @VIncent_AZK 

     

    So all input value. Example 202401 have only one row in excel or it has multiple rows as well?

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

  • Verified answer
    Deenuji_Loganathan_ Profile Picture
    6,255 Moderator on at

    @VIncent_AZK 

     

    Please follow the below approach:

    Deenuji_0-1718878346008.png

     

    Code(Copy and paste the below code into your power automate desktop):

    Variables.CreateNewDatatable InputTable: { ^['Input Data', 'File Name', 'Excel cell Column', 'Folder Name'], [202401, $'''Headcount File - Jan 24''', $'''A''', $'''01 Jan -24 Headcount Doc'''], [202402, $'''Headcount File - Feb 24''', $'''D''', $'''02 Feb -24 Headcount Doc'''] } DataTable=> DataTable
    Variables.RetrieveDataTableColumnIntoList DataTable: DataTable ColumnNameOrIndex: 0 ColumnAsList=> ColumnAsList
    Display.SelectFromListDialog.SelectFromList Title: $'''Select Input''' Message: $'''Select Input''' List: ColumnAsList IsTopMost: False AllowEmpty: False SelectedItem=> Selectednumber SelectedIndex=> SelectedIndex ButtonPressed=> ButtonPressed
    LOOP FOREACH CurrentItem IN DataTable
     IF CurrentItem[0] = Selectednumber THEN
     SET FileName TO CurrentItem[1]
     SET CellColor TO CurrentItem[2]
     SET FolderName TO CurrentItem[3]
     END
    END

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

  • VIncent_AZK Profile Picture
    25 on at

    Thanks a lot. Can I just confirm where can I enter the code you have provided? 

     

    VIncent_AZK_0-1718940318841.png

     

     

    Because when I open Datatable, it give me this only so can not paste in your code.

    VIncent_AZK_1-1718940383974.png

     

  • Verified answer
    NathanAlvares24 Profile Picture
    1,714 Moderator on at

    Hi @VIncent_AZK !

     

    @Deenuji meant to copy-paste that code onto your flow under a subflow.

     

    Here are more detailed instructions on how to copy-paste it onto your flow:
    1. Go to your flow

    NathanAlvares24_0-1718941534032.png

     

    2. Copy this code (given in red)

    NathanAlvares24_2-1718941695994.png

     

    3. Right click on your subflow (or main) and select Paste from the options

    NathanAlvares24_3-1718941830422.png

     

    Voila!!!

    Output:

    NathanAlvares24_4-1718941871348.png

     

  • Deenuji_Loganathan_ Profile Picture
    6,255 Moderator on at

    @NathanAlvares24  - Thanks

     

    @VIncent_AZK  - Please follow Nathan above guidance and let us know in case if you facing any issues. 

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 229 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 227

#3
Haque Profile Picture

Haque 181

Last 30 days Overall leaderboard