Skip to main content

Notifications

Community site session details

Community site session details

Session Id : e4jly3IQYgvCqFb+TQlfY2
Power Apps - Building Power Apps
Answered

Changing data source without needing to rebuild all form datacards

Like (1) ShareShare
ReportReport
Posted on 19 Dec 2022 04:46:30 by 343

I have developed a form canvas app with a list as a data source. While testing this I created the list in My lists. Now that testing is done and the app is complete I have cloned this list from the dev site to the sharepoint site this app is for. However now I need to change the data source to this clone and I cannot find a way to do this that doesn't replace all of the datacards in the form. If I replace all of the datacards I have to pretty much redo most of the app because of the positioning and formatting changes (eg. fields with radio buttons change to dropdown lists). If I don't replace the datacards and delete the old data source they then disappear as well. The new data source (list) is literally identical to the old one so I'm not sure why the change is resetting everything.

 

Is there a way to change the data source without needing to rebuild the app?

  • AzoLinus Profile Picture
    5 on 26 May 2024 at 22:07:06
    Re: Changing data source without needing to rebuild all form datacards

    @AlanMcK This is a much better and easier way to replace a data source (when the new data source and the underlying elements have the same name).

  • AlanMcK Profile Picture
    68 on 16 Apr 2024 at 10:54:25
    Re: Changing data source without needing to rebuild all form datacards

    I actually deleted the old Datasource before adding the new, duplicate data source and it all just worked ... no need to click on the red Xs.

    (I also populated my duplicate list using a Flow, as in this example: https://techcommunity.microsoft.com/t5/sharepoint/copy-sharepoint-list-to-the-another-new-site/m-p/1843245)

  • amalinabaharudd Profile Picture
    2 on 06 Nov 2023 at 11:14:18
    Re: Changing data source without needing to rebuild all form datacards

     

    hi, i have tried as per the solution, however there is still error in my )Screenshot_1.png

  • Verified answer
    Power_Automater Profile Picture
    343 on 19 Dec 2022 at 06:25:15
    Re: Changing data source without needing to rebuild all form datacards

    Ok I have worked it out, I was just getting the steps wrong, here it is:

     

    1. Make sure both lists are exactly the same. You can do this by going to the lists app (instead of accessing your list in which ever sharepoint site it is in), since you can then make a new list, create based on existing, and select your old list. If you have built the list in My Lists like me you won't be able to select it in the "based on existing list" selection since My Lists isn't available.
    2. Create a new data source in power apps. It will add a suffix since it has the exact same name as the original data source.
    3. Now change the form's data source to the new one, BUT do not replace the datacards (this is where I was going wrong).
    4. Now delete the old data source.
    5. You will get a bunch of red Xs and your fields will disappear, but all you need to do is click on each X and select to be taken to the formula.
    6. All you will need to do is add the suffix of the new data source to the new data source name in the formula bar, and each time you do the X will disappear and the field will reappear. Repeat until all fields are referencing the new data source.
    7. Test the app and you should now see a new item being created in the new data source and not in the old one!
  • v-qiaqi@microsoft.com Profile Picture
    on 19 Dec 2022 at 06:09:32
    Re: Changing data source without needing to rebuild all form datacards

    HI @Power_Automater,

    I am sorry that there is no other more efficient way to achieve your need.

  • Power_Automater Profile Picture
    343 on 19 Dec 2022 at 05:53:09
    Re: Changing data source without needing to rebuild all form datacards

    That looks like a great way to build going forward @v-qiaqi-msft , but it doesn't appear to present any immediate way to do what I need. Wouldn't I have to completely rebuild everything from inside a solution first? If so that is even more work than rebuilding just the form.

  • v-qiaqi@microsoft.com Profile Picture
    on 19 Dec 2022 at 05:19:35
    Re: Changing data source without needing to rebuild all form datacards

    Hi @Power_Automater,

    You could try the environment variables, ideally you'd only have to change the value of the environment variable in the solution to switch from one data source to another.

    You do have to make sure that the structure of both data sources is the same though.

     

    Here is a detailed tutorial:

    Solutions in Power Platform | ALM, Power Apps, flows & Environments - YouTube

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,743 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,089 Most Valuable Professional

Leaderboard