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:
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.
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)
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.
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.
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.
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.
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.
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.