cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cchan000
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

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

17 REPLIES 17
v-monli-msft
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.

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

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

Ximo
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

vammers
Frequent Visitor

Did you find a solution to this ?

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.

@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.

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.

 

zeet
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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,497)