Hi all.
I have an excel data from an excel worksheet. It contain 11 rows and 16 columns. (see some pictures below)
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.
the problem is that it only shows T1001 and not T1001 (2). This is what i would like the result to be.
I´d appreciate any help and thankful if explanation is easy to understand since i´m newbie. Thanks again.
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.
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:
and when i open DataTableMatches it is empty.
This is my exceldata which contains 11 rows 16 columns with first row is header.
This is my selection in Find and replace action
Thanks.
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.
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.
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!
Use find and replace activity
enable regular expression option then give the pattern as T1001.*
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
WarrenBelz
146,731
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,075
Most Valuable Professional