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 / Use Array in Parameter...
Power Automate
Unanswered

Use Array in Parameterized Query - SQL Server

(0) ShareShare
ReportReport
Posted on by 221

I am trying to pass an array data Grade to my flow. But it only read it as one string.

JeffGimo_3-1646760324640.png

replace(replace(replace(string(triggerBody()?['Grades']), '["', ''''), '"]', ''''), '","', ''',''')
select * from [SchoolOutreach-Grades] where Grade_Desc in (@Grade);

 

Here's a sample run:

input:

JeffGimo_1-1646760090276.png

Then 0 output because it cannot query Grades because it reads those 2 values as 1 whole string.

Here's the raw input.

JeffGimo_4-1646760458410.png

 "body": {
 "actualParameters": {
 "Grade": "'Grade 2','Grade 5'"
 },
 "formalParameters": {
 "Grade": "nvarchar"
 },
 "query": "select * from [SchoolOutreach-Grades] where Grade_Desc in (@Grade);"

 

 

However, the query works if I move the data transformation at the query itself. But this is not desirable because it will be prone to SQL Injection attack.

JeffGimo_5-1646760592128.png

 

 

Please help. Let me know if you need more information.

Categories:
I have the same question (0)

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

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard