Best answer

How to retrieve all rows matching a specific parameter in a MS SQL database column with Zapier?


Userlevel 2

I’m using a Zap to retrieve data from our MS SQL database. I need the zap to retrieve every row that match a certain parameter in a specific column. For instance, I need every row that has invoice # 3511151 in the invoice # column of the table. Is this possible?

icon

Best answer by SamB 9 May 2024, 16:28

View original

82 replies

Userlevel 7
Badge +11

Hey folks,

Just circling back in here to share that the feature request has been closed - a new Find Multiple Rows via Custom Query action has been added to the latest version of the MySQL app. 😁🎉

That action will allow you to use a custom query to fetch multiple rows. If you’re not able to see that action in your Zaps you may need to upgrade the Zaps to use the latest version of the MySQL apps. You can learn more about upgrading apps in a Zap here: Update to the latest app version in Zaps

Hope you’re able to give that new action a try soon. If you run into any issues with it please do reach out in the Community to let us know. In the meantime, happy Zapping! ⚡

Userlevel 7
Badge +11

Your vote has been added to the feature request now, @jfreeman1412. As ever, we’re unable to provide any timelines on when it may be implemented by but we’ll definitely be in touch once it is! 🙂 

Please add another vote for me. 

Userlevel 7
Badge +11

Hi @isaiah_p 👋

I’ve just checked again and it’s still not been added yet. I’ve added your vote which helps to bump up it’s priority but I can’t give an estimate on when you can expect it to become available. 

Thanks for everyone’s continued patience here. We’ll keep this thread updated with and additional updates or workarounds we come across in the meantime!

Is this still not solved? 

Userlevel 7
Badge +11

Sorry to hear Mark B’s suggestion won’t work for your Zaps @MortEdBrad. I can totally understand how disappointing it must be to wait this long for this feature to be added. And I really wish I was writing back with better news but we can't commit to any timeline or give any guarantee as to when this feature request would be implemented. It appears our Support team had previously added your vote though which will allow us to notify you via email once it’s added.


@asg3 - Ah, yes if you’re specifically wanting to loop through items in a Sub-Zap and then send that to another Zap it wouldn’t work as you can’t add a loop action step in before a Return from Sub-Zap action step. If we come across any alternative workarounds we’ll be sure to share them here. Sorry to not have a more immediate solution on this right now.  

Userlevel 1
Badge

I’ve figured out quite a simple workaround for this.

Firstly you need to run a Find Row via Custom Query in SQL Server statement that selects the key of each of the elements in your list. So if you imagine your table called FOOD is like this:

 

and you want to loop through all the elements that are type ‘Hot’

Run a SQL Select that looks like this:

select replace((stuff((select ',' + str(id) FROM Food where type = ‘Hot’ FOR XML PATH('')),1,1,'')), ' ', '') as ID

That will return a single element with the value ‘2,3’

You then use Create a Loop from Text that loops through each id in the results from above in turn with the sub loop elements able to reference each Key (Id) value in turn so you can update, or read or whatever using other SQL functions.

A limitation to this approach is Loops don't work in sub-zaps and loop have to be at the end of a zap. So it works if you have a discrete process to run on multiple records, but not if you want to process multiple records and then continue on to do something else within the same zap.

Mark B’s suggestion won’t work if you don’t have a unique column in your data set. I can’t believe it has been 3 years and there still is no solution. MySQL queries return multiple rows all the time!!

Is there any chance this request will ever be addressed? It has been 3 years...

Userlevel 7
Badge +11

Thanks for reaching out here, @asg3. We’ve added your vote to the feature request and will be in touch by email once it’s added. 🙂

Userlevel 1
Badge

One more request for this feature.

Userlevel 7
Badge +11

Sure thing, @ManorlyDev! I’ve added your vote to the feature request so we’ll be sure to notify you as soon as it’s added. I’d recommend giving the workaround Mark B suggested here a try in the meantime. 

I cannot believe this has been open for 3 years! It is so obvious and critical a need. Please add my email to the list.

S Gibbs

Userlevel 7
Badge +11

Hi @L1dert

Prioritisation for feature requests and bugs is largely dependent on the number of customers affected. I can’t make any promises as to when it would be implemented but I’ve added your vote to the feature request which helps to further increase it’s priority.

In the meantime it might be worth giving the workaround Mark B shared here a try. 🙂

Add me to this request please.
I kind of understand why you are not implementing this. It's costing you zaps… right? I mean it's super easy to implement

Userlevel 7
Badge +11

Thank you so much for reaching out here, @Mark B! 😁

We really appreciate you sharing this workaround. I’m sure there are lots of folks in Community that will use it for their Zaps! 🙌

Userlevel 1

I’ve figured out quite a simple workaround for this.

Firstly you need to run a Find Row via Custom Query in SQL Server statement that selects the key of each of the elements in your list. So if you imagine your table called FOOD is like this:

 

and you want to loop through all the elements that are type ‘Hot’

Run a SQL Select that looks like this:

select replace((stuff((select ',' + str(id) FROM Food where type = ‘Hot’ FOR XML PATH('')),1,1,'')), ' ', '') as ID

That will return a single element with the value ‘2,3’

You then use Create a Loop from Text that loops through each id in the results from above in turn with the sub loop elements able to reference each Key (Id) value in turn so you can update, or read or whatever using other SQL functions.

Userlevel 6
Badge +3

Hi @BackwoodsMag 

I’ve added your vote for this feature request, and we’ll  notify you via email once an update is readily available. Thanks.

Please add me to the vote. 

Userlevel 6
Badge +3

Hi @saintbrian 

I’ve added your vote for this feature request, we’ll notify you via email once available. Thanks!

Userlevel 1
Badge

Add me to … seems silly that this request has been in queue for over 2 years.  You’ve enabled a custom SELECT from SQL, but you only allow inserting 1 record.  I’m not even sure how this is helpful.

Userlevel 6
Badge +3

Hi @alkakandilli 

I’ve added your vote for this feature request, we’ll notify you via email once available. Thanks!

One more vote from me

Userlevel 6
Badge +3

Hi @MFav,

I’ve added your vote for this feature request, we’ll notify you via email once available. Thanks!

 

One more vote from me on that please.

Thanks

Userlevel 6
Badge +3

Hi @dubbs 

I’ve added your vote for this feature request, we’ll notify you via email once available. Thanks!

Reply