cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jwxc
Frequent Visitor

Cannot get Import control to work

I have successfully set up an Export control to save the contents of a collection to a file. However, I am unable to work out the correct way of configuring an Import control to get this data back into a collection which can be used in the app.

My control is called impImportData and I have tried using the following code in the OnSelect property of the Import control itself and a separate button:

 

 

ClearCollect(colImportedData,impImportData.Data)

 

 

Whatever I try, I just get the error 'Invalid argument type' with the predominant red squiggle under the .Data part of the code. I have tried using impImportData.Data as a source for a DataTable but it complains that it is not being passed a Table. It seems therefore that the data is not being imported as a Table.

I have looked at the documentation for these controls but it isn't very detailed. I don't believe I have done anything that different to the example given. https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-export-import 

Has anybody been able to get this working successfully in their own apps? Any pointers would be appreciated.

8 REPLIES 8
WarrenBelz
Super User
Super User

Hi @jwxc ,

You have not said what your data source is, however the relevant table name will appear under View > Data Sources

You are trying to import the control rather than the data. I will call the name of your data source as it appears in this list MyData

To collect this data (assuming there re less than 2000 records)

 

ClearCollect(colImportedData,MyData)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

jwxc
Frequent Visitor

Thanks for your response, but I think you've misunderstood as I'm not trying to collect data from a Data source. I'm trying to use the Import control to import data from a zip file (as created by an Export control). These files contain a few json files and allow you to export and import Collections between apps.

Please read this post.
https://powerusers.microsoft.com/t5/Building-Power-Apps/Import-Export-Controls/td-p/16357

If you like this post, give a thumbs up. Where it solved your issue, Mark as a solution
jwxc
Frequent Visitor

Thank you. I already searched the forums and found that post, but it doesn't actually solve the problem. Taking that approach suppresses the error, but it doesn't populate a collection. When I check the contents of the collection, it is completely empty and doesn't even have a Data column.

I can't work out what data type is returned by .Data - I think that would be a good starting point to solving this.

v-xida-msft
Community Support
Community Support

Hi @jwxc ,

Could you please share a bit more about your error message?

 

I have made a test on my side, and don't have the issue that you mentioned. Based on the issue that you mentioned, I have made a test on my side, the issue is confirmed on my side.

 

I would post this issue to my product team, if this issue is solved, I would reply here.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-xida-msft
Community Support
Community Support

Hi @jwxc ,

I have posted this issue to my Product Team already. If there are any updates from them, I would reply here. Thanks for your feedback.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
jwxc
Frequent Visitor

Hi @v-xida-msft ,

Thank you for passing this onto the Product Team.

I'm not sure what else I can tell you about the error, but I've attached a screenshot of it. The formula is being used in the OnSelect of my Import Data control.

It might be that I'm just using the control wrong, but there is little documentation on it and I've followed what is there as best as I can. Any suggestions or advice would be most welcome.

JoaoN
Helper IV
Helper IV

Any Update @v-xida-msft ??

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (3,244)