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 Automate
Unanswered

Run .net script error

(0) ShareShare
ReportReport
Posted on by 2

Hi,

I am currently learning Power Automate Desktop. I have created a flow to extract data from web and the output is a datatable.From the data table i need to filter out some rows. Have tried using linq query  "DataRow[] dr=inDtTable.asenumerable().select("[type]=WI2");" also i have loaded the references "System.Data.DataSetExtensions.dll" file. But i am stuck with an error and it is attached below. can anybody help me on this

 

 

Sreejith_lal_0-1717760197090.png

Thanks

Sreejith S S

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

    @Sreejith_lal 

     

    From my experience, I've had significant difficulties with .NET scripting using LINQ. Therefore, I tend to avoid LINQ and rewrite my code without LINQ concepts, which results in it working flawlessly in .NET scripts.

     


    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 🚀

  • Srini007 Profile Picture
    3,490 Super User 2026 Season 1 on at

    Hi @Sreejith_lal 

     

    Try as below

     

    Variables.CreateNewDatatable InputTable: { ^['type'], [$'''WI2'''], [$'''WI2'''], [$'''CI2'''], [$'''CI2'''] } DataTable=> DataTable
    Scripting.RunDotNetScript Language: System.DotNetActionLanguageType.VisualBasic ReferenceRootPath: $'''D:\\assemblies''' Script: $'''outDatatable = inDatatable.AsEnumerable().
     Where(Function(r) r.Field(Of String)(\"type\") = \"WI2\").
     CopyToDataTable()''' @'name:inDatatable': DataTable @'type:inDatatable': $'''Datatable''' @'direction:inDatatable': $'''In''' @'name:outDatatable': $'''''' @'type:outDatatable': $'''Datatable''' @'direction:outDatatable': $'''Out''' @outDatatable=> outDatatable
    

     

    Linq Query to select the type column where it has WI2

    outDatatable = inDatatable.AsEnumerable().
     Where(Function(r) r.Field(Of String)("type") = "WI2").
     CopyToDataTable()

     

    Above linq query will filter all the rows of column type as WI2 and output to a datatable, so you need to have a out direction of outDatatable with Datatable as type

     

    Let me know any other errors you are facing

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Cheers,

    Srini

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
11manish Profile Picture

11manish 233

#2
David_MA Profile Picture

David_MA 217 Super User 2026 Season 1

#3
Valantis Profile Picture

Valantis 190

Last 30 days Overall leaderboard