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 / how to convert string ...
Power Automate
Unanswered

how to convert string variable to sql connection string?

(0) ShareShare
ReportReport
Posted on by 162

I had sql connection variable in string format! how can i convert it  and use in execute sql statement (SQL COnnection) ?

MitheshRpa_0-1718201124627.png

 

I have the same question (0)
  • VishnuReddy1997 Profile Picture
    2,666 Super User 2026 Season 1 on at

    Hi @MitheshRpa ,

     

    Please find the below solution.

    VishnuReddy1997_0-1718254667164.png

     

    Code:

    SET Excel_A_File_Path TO $'''C:\\Users\\OneDrive\\Desktop\\Power Automate Desktop\\Practice\\Database\\Excel A.xlsx'''
    SET OLEDB_ConnectionString TO $'''Provider=Microsoft.ACE.OLEDB.12.0;Data Source=%Excel_A_File_Path%;Extended Properties=\"Excel 12.0 Xml;HDR=YES\";'''
    Database.Connect ConnectionString: OLEDB_ConnectionString Connection=> SQLConnection
    @@copilotGeneratedAction: 'False'
    Database.ExecuteSqlStatement.Execute Connection: SQLConnection Statement: $'''select * from [Sheet0$] WHERE [Type] <> \'e-Remito\';''' Timeout: 30 Result=> QueryResult
    Database.Close Connection: SQLConnection

     

    (Note:- if you got your solution you can mark as solution and gives kudos)


    Thanks & Regards

    Vishnu Reddy

     

  • MitheshRpa Profile Picture
    162 on at

    I had 10+ sql connection, I am using sql connection and storing the value in dictonary !!!

     

    I want to call the connections which is in string format to sql connection data type

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 474

#2
11manish Profile Picture

11manish 268

#3
David_MA Profile Picture

David_MA 243 Super User 2026 Season 1

Last 30 days Overall leaderboard