cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

how to change the data source in powerapps?

hi. i have a powerapps form linking to a sharepoint site data source. how do i delete that data source and replace all instances of it with another sharepoint data source?

 

reason: i used a tutorial on this site and was able to export my powerapps form to another site. the new sharepoint site is exact mirror of the old site. the exported form carried over it's old datasource connection, just need to replace that part.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Hi @cchan000 ,

 

I'm afraid that is not possible currently. When you change the data source of the Form control, all before customized design for the data cards would be reset with the new data source.

 

The workaround so far is creating code components. For more information, please refer to:

https://docs.microsoft.com/en-us/powerapps/developer/component-framework/overview

 

If you need this feature, consider to add an idea in below forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

Regards,

Mona

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

View solution in original post

9 REPLIES 9
Highlighted
Community Support
Community Support

Hi @cchan000 ,

 

Is it a standalone app or a custom form created from SharePoint list?

 

You can delete the data sources from View > Data Sources > Select "..." > Remove

Capture.JPG

 

Then add the new data source from the same section.

 

But please remember to change the data source name to the new one in all the formulas in this app and the old column names to the new column names too. And it is recommended to delete the old data cards in the fom controls and then add with the new fields.

 

Regards,

Mona

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

thanks! almost worked. is there any way to AVOID replacing all data cards? it loses the formatting and my design.

 

the new data source sharepoint has the exact same fields and values.

 

error.png

Highlighted

Hi @cchan000 ,

 

I'm afraid that is not possible currently. When you change the data source of the Form control, all before customized design for the data cards would be reset with the new data source.

 

The workaround so far is creating code components. For more information, please refer to:

https://docs.microsoft.com/en-us/powerapps/developer/component-framework/overview

 

If you need this feature, consider to add an idea in below forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

Regards,

Mona

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

View solution in original post

Highlighted
Frequent Visitor

Hi,

same situation and same problem here!

Canvas app with a SharePoint list as Datasource: when imported into Production from Development environment we have to rebuild almost from scratch the app.

Is there any solution?

Thanks in advance

Highlighted
Frequent Visitor

Did you find a solution to this ?

Highlighted

I have this issue right now and there is an obvious solution that should work...but doesn't.

 

When you download a PowerApp to your desktop, you can see that they are mainly just zipped collections of json files. It should be as easy as opening each of the files in the Controls directory (each file is a page in the app) and doing a find/replace all on the data source name.

 

However, Microsoft have made changes to PowerApps which now mean that any modifcation to these files make them disappear from your app when you upload it. This is a massive step backwards for people who want to make global changes like data source, or situations like if their company rebrands and suddenly you have to change the colourscheme on every control on every page in every app you manage.

Highlighted

@v-monli-msftCould you please elaborate on the code components workaround?

I have the same problem: I would like to import an canvas app and change a sharepoint connection without loosing all my datacard customizations.

Highlighted

Here is how I have done it.

 

1. write a powershell script to generate a XML file in the following format. This should contain the all the list and views used in your app. Field Guids are not needed. You will need a mapping file for each environment / Source sharepoint site.

<items>

<mapping name="ListA" sourceGUID="" targetGUID="" />

<mapping name="ListB" sourceGUID="" targetGUID="" />

<mapping name="ListAView" sourceGUID="" targetGUID="" />

</items>

2. Use the powershell commands from the XRM solution sdk to unpack the solution and un pack the powerapp

3. Use another powershell script to read the xml file and update the files extracted in step 2

4. use the powershell commands to pack the file and solution

 

We have the steps 2,3 and 4 in the release pipes to ensure auto deployment. 

step 1 is needed to be done only once per environment / target site.

 

Sorry, I do not have the scripts handy to share.

 

Highlighted
New Member

Hi all,

 

Anybody managed to solve this in a way or another.

@vammerswould you please share the scripts if possible?

 

Thank you!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (5,565)