Skip to main content

Notifications

Community site session details

Community site session details

Session Id : Mwgg+Wm5+FCC9Z8J6eob+1
Power Automate - Power Automate Desktop
Unanswered

Suggestion needs for building a power automate desktop flow.

Like (0) ShareShare
ReportReport
Posted on 3 Dec 2023 11:29:27 by 74

Hi all.

I have an excel data from an excel worksheet. It contain 11 rows and 16 columns. (see some pictures below)

Atlantis1_0-1701601461450.png

Atlantis1_1-1701601667108.png

My flow will ask a user to enter T1001 for example and with that value i need to find and display all the information belongs to T1001 (even T1001 (2)) columns in that excel data which matches what the user has entered. Basically the user only enters any T number within that data table and my job is to find and display all the information belongs that match the user´s entered T number.

 

This is what my flow looks like at the moment.

Atlantis1_2-1701602449664.png

the problem is that it only shows T1001 and not T1001 (2). This is what i would like the result to be.

Atlantis1_3-1701602704817.png

I´d appreciate any help and thankful if explanation is easy to understand since i´m newbie. Thanks again.

 

 

 

  • Agnius Bartninkas Profile Picture
    10,045 Most Valuable Professional on 07 Dec 2023 at 08:03:20
    Re: Suggestion needs for building a power automate desktop flow.

    It doesn't find anything. And that's because the value you are looking for is not within the values of the table, but are in fact in the header row.

     

    When that is the case, you don't need to find it. You can reference a value like this: %ExcelData[0][UserInput]%. The 0 here indicates row 1. Depending on which row you want, you can pass a different index (or use a loop to get all of them). You can also use %UserInput% as the name of the column in Retrieve data table column into list to retrieve the entire column into a list, and have a list of all the items related to this one code from user input.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • Atlantis1 Profile Picture
    74 on 05 Dec 2023 at 19:51:05
    Re: Suggestion needs for building a power automate desktop flow.

    Hi Agnius

    I tried your suggestion but no matter what i have like all matches in Find or replace in data table action it still has this:

    Atlantis1_0-1701805570343.png

    and when i open DataTableMatches it is empty.

    Atlantis1_2-1701805822523.png

    This is my exceldata which contains 11 rows 16 columns with first row is header.

    Atlantis1_1-1701805706044.png

    This is my selection in Find and replace action

    Atlantis1_3-1701805977279.png

     

    Thanks.

     

  • Agnius Bartninkas Profile Picture
    10,045 Most Valuable Professional on 04 Dec 2023 at 18:43:13
    Re: Suggestion needs for building a power automate desktop flow.

    Use the Find or replace in data table action and make it return all matches, as well as not try to match the full cell contents.

     

    This will return a data table with column and row indexes for each match found in the table. Each match will result in a row in the matches table. You can then use those to return all data from your original data table.

    -------------------------------------------------------------------------

    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

     

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • Atlantis1 Profile Picture
    74 on 04 Dec 2023 at 17:47:24
    Re: Suggestion needs for building a power automate desktop flow.

    Hi MichaelAnnis.

    Thanks for your suggestions. I never thought VBA can be a solution. My problem is that i´m not neither as good as you in vba or pad. But i will try to digest your suggestion and let see how far i can go. 

     

    Hi Usha.

    Thanks for your time looking at my request. You suggest enable regular expression function and i´d be grateful if you can create a flow so i can try and learn some new feature in pad.

    Please take a look at my shortcome flow:

    SET FilePath TO $'''C:\\Users\\DD\\Desktop\\PAD\\WM interface per maskin\\W interface per maskin_test.xlsx'''
    Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: FilePath Visible: True ReadOnly: True Instance=> ExcelInstance
    Excel.GetFirstFreeColumnRow Instance: ExcelInstance FirstFreeColumn=> FirstFreeColumn FirstFreeRow=> FirstFreeRow
    Excel.ReadFromExcel.ReadCells Instance: ExcelInstance StartColumn: $'''B''' StartRow: 1 EndColumn: FirstFreeColumn - 1 EndRow: FirstFreeRow - 1 ReadAsText: False FirstLineIsHeader: True RangeValue=> ExcelData
    Excel.CloseExcel.Close Instance: ExcelInstance
    Display.InputDialog Title: $'''VERKTYGS KOMPENSERING FÖR SVARVSTÅL''' Message: $'''Skriv SvarvStål börjar me T''' InputType: Display.InputType.SingleLine IsTopMost: False UserInput=> UserInput ButtonPressed=> ButtonPressed
    Variables.CreateNewDatatable InputTable: { ^['Column1', 'Column2', 'Column3', 'Column4'], [$'''''', $'''''', $'''''', $''''''], [$'''''', $'''''', $'''''', $''''''], [$'''''', $'''''', $'''''', $''''''], [$'''''', $'''''', $'''''', $''''''], [$'''''', $'''''', $'''''', $''''''], [$'''''', $'''''', $'''''', $''''''], [$'''''', $'''''', $'''''', $''''''], [$'''''', $'''''', $'''''', $''''''], [$'''''', $'''''', $'''''', $''''''], [$'''''', $'''''', $'''''', $''''''], [$'''''', $'''''', $'''''', $''''''], [$'''''', $'''''', $'''''', $''''''] } DataTable=> DataTable
    LOOP FOREACH CurrentItem IN ExcelData.Columns
    IF Contains(CurrentItem, UserInput, False) THEN
    DISABLE Variables.RetrieveDataTableColumnIntoList DataTable: CurrentItem ColumnNameOrIndex: UserInput ColumnAsList=> ColumnAsList
    Display.ShowMessageDialog.ShowMessage Message: CurrentItem Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed2
    END
    END

    and this is the excel file.

     

     

     

  • MichaelAnnis Profile Picture
    5,721 Super User 2025 Season 1 on 04 Dec 2023 at 15:54:18
    Re: Suggestion needs for building a power automate desktop flow.

    VBA would make faster work of this.

     

    Get input from user
    For each column, if row 1 value does not contain input, delete column.

     

    Advantage:  Your team could use this directly in Excel, and they wouldn't need to use PAD.

     

    Further functionality.  You could just create a single macro (no input needed) that divides the workbook up into all variations (1 workbook per user) and saves out each workbook for them to access.

     

    I don't know what happens after this phase of your flow, but if each one was already separated, it would be really easy for the bot to grab it, then you don't need the bot to do anything but:

    Open workbook
    Run Macro
    'then do whatever else you were going to do with the data

    Good luck!

  • UshaJyothiKasibhotla Profile Picture
    6 Super User 2025 Season 1 on 04 Dec 2023 at 07:34:49
    Re: Suggestion needs for building a power automate desktop flow.

    Use find and replace activity

    enable regular expression option then give the pattern as  T1001.*

    UshaJyothi20_0-1701675193907.png

    then give these column names to retrieve coloumn into list activity 

     

    Hope this helps

    Usha 

    for more clarification please share sample excel file so that i can give a try

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,731 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,075 Most Valuable Professional

Leaderboard