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 / Extracting datagrid bu...
Power Automate
Answered

Extracting datagrid but it returns duplicate text values

(0) ShareShare
ReportReport
Posted on by 49

I'm trying to extract text values from a datagrid into datatable but each cell has the same text twice. How can I get only once?

 

Screenshot 2023-12-06 172302.png

 

 

Screenshot 2023-12-06 042723.png

 

 

Screenshot 2023-12-06 052344.png

  • dzek Profile Picture
    49 on at

    It seems that it returns UI custom and text values. How can I get only the text values?

  • Riyaz_riz11 Profile Picture
    4,214 Super User 2026 Season 2 on at

    Hello @dzek ,

     

    After storing into variable whether you can store it into list and remove from that, else after storing into excel again read from that using sql distinct query and you will get the expected output.

     

    If it helps mark as solution and thumbs up

    Regards,

    Riyaz

  • UshaJyothiKasibhotla Profile Picture
    225 Moderator on at

    Hi @dzek 

    If you want to remove duplicates the

    this is the sample flow

    try this way and implement according to your inputs 

    UshaJyothi20_0-1701840968365.png

     

    Hope this helps

    Usha

     

  • dzek Profile Picture
    49 on at

    So there is no solution by exporting directly to

    come out once? Im not on my pc right now but i will check this method.

  • dzek Profile Picture
    49 on at

    Im not sure if i understand what i have to do.

  • Riyaz_riz11 Profile Picture
    4,214 Super User 2026 Season 2 on at

    Do you know how to read excel as a Database, then it will be more good

    Select Distinct Age

    from [Sheet1$]

     

    So here you will be get only the distinct value

  • dzek Profile Picture
    49 on at

    It doesnt work. I still get 2 values in each cell

  • dzek Profile Picture
    49 on at

    @Agnius any help here?

  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Use Find or replace in data table on your data table like this:

    Agnius_1-1701938891781.png

     

     

    This will use regular expressions to find the values. The regex is "\n.+" which stands for a newline followed by any characters. So, essentially, matching everything that is not in the first line within any cell.

     

    Set the action to "Find and replace" and use %''% as the value to replace matches with. This will effectively replace everything outside of the first line of each cell with an empty string. So, essentially, remove all of your duplicates.

     

    Here's a snippet of the action you can copy and paste into your flow designer to have the action created for you:

     

    Variables.FindOrReplaceInDataTable.ReplaceItemInDataTableWithRegexEverywhere DataTable: DataTable AllMatches: True ValueToFind: $'''\\n.+''' TextToReplaceWith: $'''%''%''' DataTableMatches=> DataTableMatches
    

     

    -------------------------------------------------------------------------
    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.

  • dzek Profile Picture
    49 on at

    Thank you for the solution but why is this happening? It looks like it takes the name of the ui element box and then takes the text value that is in the box. By extracting the data normally shouldn't it only get the text values?

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

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 227 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 132

Last 30 days Overall leaderboard