web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch Sharepoint list ...
Power Apps
Answered

Patch Sharepoint list but with LCM

(0) ShareShare
ReportReport
Posted on by 80

I've got 2 lists, Onboard & Onboard-DEV.

The Onboard is the production list and the other the development.

I can't get it to work to switch in environments in the patch function.

Based on a flow I know in which environment I am working and want to use this to switch in sharepoint list.

I tried the following query: 

 

Patch(If(varEnvironment = " DEV",'Onboard-DEV', 'Onboard') ,{

 

Onboard is a direct copy of Onboard-DEV.

When using both separate they work, but combined not (then every column isn't recognized anymore).

 

The problem is that the application is a Standard application and can't be a premium (yet),

Is there any smart way? Or should I do the following (which i don't want).

 

if(varEnvironment = " DEV", 
 Patch('Onboard-DEV',{}),
 Patch('Onboard',{})
);

 

There are quite some columns which will be updated from here.

 

Last option is to add a column "Environment" and just put PROD/DEV over there and adjust all my other windows in the app.

Thanks in advance.

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,831 Super User 2026 Season 1 on at

    Hi @JoostCuppes ,

     

    Environment variables should be your go-to solution for this issue: https://learn.microsoft.com/en-us/power-apps/maker/data-platform/environmentvariables

  • Joost Cuppes Profile Picture
    80 on at

    @BCBuizer But thats the big problem... When I am going to use this it switches to Premium, because the environment variables are saved in a dataverse table.

  • BCBuizer Profile Picture
    22,831 Super User 2026 Season 1 on at

    Hello @JoostCuppes ,

     

    According to the documentation no premium license is required for using environment variables: https://learn.microsoft.com/en-us/power-apps/maker/data-platform/environmentvariables#are-premium-licenses-required

  • vikas1606 Profile Picture
    206 on at

    Hi @JoostCuppes ,

     

    You can take a look at the below blog have a scenario of moving from one environment to another using environment variables. Also, As @BCBuizer  mentioned it does not require any premium license.

     

    https://powerusers.microsoft.com/t5/Power-Apps-Community-Blog/Environment-variable-in-Power-Platform/ba-p/2065291

     

  • Joost Cuppes Profile Picture
    80 on at

    @vikas1606 @BCBuizer Thanks! Thought because it was used in Dataverse it was Premium as well.... I have added the environment variable in the PowerApp and it switches to Premium again. (in Power Automate is works well)

  • Verified answer
    BCBuizer Profile Picture
    22,831 Super User 2026 Season 1 on at

    Hi @JoostCuppes ,

     

    How do you 'add' to your app?

     

    What you should do is to have at least 2 variables and your app in the same solution. 

     

    The first variable is for the site URL:

    BCBuizer_2-1679590263533.png

     

     

    The second one is for the list and should use the Site URL variable:

    BCBuizer_1-1679590174851.png

     

    If this is all set, go to the app and when adding the data source, select the Advanced tab to find your variables:

     

    Site:

    BCBuizer_3-1679590512946.png

     

    List: 

    BCBuizer_4-1679590555897.png

    After completion you will only see your SharePoint data source in the app data:

     

    BCBuizer_6-1679590687422.png

     

     

    More importantly, the license designation remains standard:

    BCBuizer_7-1679590768085.png

     

    As long as you set the environment variables correctly in the environments you export the solution to, you can use them without the need for a premium license.

     

  • Joost Cuppes Profile Picture
    80 on at

    OMG @BCBuizer Never knew this! This works like a charm! Just added the Sharepoint List and going to try it! Thanks! 

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard