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 / [PA Desktop] Using str...
Power Automate
Unanswered

[PA Desktop] Using string value as variable accessor

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hey guys,

 

I'm trying to build a dynamic SQL query in power automate desktop that uses a string value to access other variables declared along the flow.

 

While testing, I made a loop iteration that sets a string variable to a template like this one:

 

Query = 
'%%item['LegalEntityName']%%',
'%%item['RegistrationNumber']%%',
'%%item['OrganisationId']%%',
'%%item['ParentOrg']%%',
'%%item['Status']%%',
'%%item['TnCsRequired']%%',
'%%item['City']%%'

 

I used double % so the flow identity those as literals.

Without the double quotes, the flow would try to access the variable, which were not declared yet.

 

Then, in a further step, I tried this in the "Execute SQL Statement".

 

INSERT INTO %Ambient%_%CurrentTable%
VALUES ( %Query% )

 

 

The problem is, the variables references inside the query are not being used to access their correspoding values, instead, the flow is sending the literal text as an SQL string.

 

Is there a way to make this work?

Thanks in advance

I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @Anonymous 

     

    Does this method helps ?

     

    Nived_Nambiar_7-1679717110939.png

     

     

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
Vish WR Profile Picture

Vish WR 382

#2
Valantis Profile Picture

Valantis 370

#3
David_MA Profile Picture

David_MA 300 Super User 2026 Season 1

Last 30 days Overall leaderboard