web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

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,656 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard