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 / Returning value from d...
Power Automate
Unanswered

Returning value from datatable based on find and replace

(0) ShareShare
ReportReport
Posted on by 10

Hi all,

 I'm looking for some help with searching and returning values from a data table. 

 

%DatafromWebPage%

#Value #1Value #2
03.99Potatoes
11.99Mushrooms
2.99Tea

 

I'm then using a "Find or Replace in data table" to find "Mushrooms" which results in this.

%datatablematches%

#RowColumn
011

 

Now what I'd like to do is return the value from %datafromwebpage% that match based on the %datatablematches% result.  (in this case 1.99)

 

I'm not sure if my brains just fried from staring at this all day but I'm running into a wall with this one.

 

Thanks everyone.

I have the same question (0)
  • kinuasa Profile Picture
    801 Most Valuable Professional on at

    Hi,
    You can retrieve values from the data table based on the row numbers found by 'Find or replace in data table' action.

     

    Regards,
    kinuasa

     

    Sample flow:

    Returning value from datatable based on find and replace.jpg

     

    Variables.CreateNewDatatable InputTable: { ^['Value #1', 'Value #2'], [3.99, $'''Potatoes'''], [1.99, $'''Mushrooms'''], [0.99, $'''Tea'''], [1.23, $'''Mushrooms'''], [4.56, $'''Tea'''], [7.89, $'''Mushrooms'''] } DataTable=> DatafromWebPage
    Variables.FindOrReplaceInDataTable.FindItemInDataTableEverywhere DataTable: DatafromWebPage AllMatches: True ValueToFind: $'''Mushrooms''' MatchCase: False MatchEntireCellContents: False DataTableMatches=> DataTableMatches
    IF DataTableMatches.RowsCount > 0 THEN
     LOOP FOREACH CurrentItem IN DataTableMatches
     Text.ToNumber Text: CurrentItem['Row'] Number=> TextAsNumber
     Display.ShowMessageDialog.ShowMessage Message: DatafromWebPage[TextAsNumber]['Value #1'] Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed
     END
    END
  • VJR Profile Picture
    7,635 on at

    If Searching for Mushrooms is returning you 1st row and 1st column then 

    1st row and 0th column is having the 1.99.

     

    For clarity purposes save these as separate variables.

     

    Set myRow as DataTableMatches[0][0] 

    Set myCol as DataTableMatches[0][1] 

     

    To get 1.99 your row is the same, only the column should be subtracted by 1.

     

    So, set myCol = myCol - 1

    Now myRow is 1

    and mycol is 0

     

    %DatafromWebPage[myRow][myCol]% will give you the element present on 

    %DatafromWebPage[1][0]%

    which is 1.99

    or you can refer it by its column name as %DatafromWebPage[myRow]['Value #1']%

     

    The ones in blue are your two options.

  • catto16 Profile Picture
    56 on at

    U saved a lot of my time with this. Thanks a ton!

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 262 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 167

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard