cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Bri
Level: Powered On

Can no longer use UpdateIf(), or Collect() on a SQL datasource

So i had one SQL datasource connection where i was able to use, the command below without any issue.

Collect('[Access].[TABLE1]', SOME_COLLECTION)

 

We then had to move our data to another SQL server and i updated the datasource connection in the app and started to change the code for the new db name, however when i updated the same commands I now get the following error: "The first arguement of 'collect' should be a collection"

 

I am running the exact same commands with the exact same data source type, why am i getting these errors now?

Collect('[dbo].[TABLE1]', SOME_COLLECTION) 

2 REPLIES 2
Eickhel
Level 8

Re: Can no longer use UpdateIf(), or Collect() on a SQL datasource

Hey,

 

It should be working with the example you're giving but can I ask you where did you have this code? maybe OnStart?

 

I've been having some issues lately running ClearCollect from OnStart.

Community Support Team
Community Support Team

Re: Can no longer use UpdateIf(), or Collect() on a SQL datasource

Hi @Bri,

 

What is your current situation?

To have the Collect(DataSource, Collection) work, you need to make sure they have the same schema.

You may first take a check of the schema of the TABLE1 with the formula below:

ClearCollect(SchemaCheck, '[dbo].[TABLE1]')

Compare it with the SOME_COLLECTION which you would like to save into the database table.

 

For how to use the collect () function, see:

Collect, Clear, and ClearCollect functions in PowerApps

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 168 members 5,335 guests
Recent signins:
Please welcome our newest community members: