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 / Environment Variables ...
Power Apps
Answered

Environment Variables and Choices() function issue

(3) ShareShare
ReportReport
Posted on by 44

Hello,

 

I have an issue with using a combination of Environment Variables with SharePoint as a Data Source. Here are the steps taken:

  1. Created a SharePoint List with couple of different fields: single line of texts, person, choice, etc. Nothing fancy. 
  2. Created a solution in one environment, added environment variable for previously created site and list
  3. Created canvas app in that solution, added connection to SharePoint with usage of previously created environment variables. Created screens for listing and editing items. All works fine for that part.

After that wanted to move that solution to a different environment in a different tenant. Here are steps taken:

  1. Removed current value of Environment Variables
  2. Published all customization
  3. Exported solution
  4. Created fresh site in other environment using PnP Provisioning
  5. Imported solution to other environment, choosed new site and list.

Now what happens is that after doing all of these steps, app itself runs okay but when trying to edit or create a record an error is thrown, saying that "The specified record was not found. List not found". When opened app in edit mode all of the fields that are using Choices() function are failing with that error, others are working fine. I could fix that by removing data sources and re-adding them again but then whole purpose of Environment Variables is lost. Is there anything that I am doing wrong? Or is it some kind of a Ms bug? (among others...)

 

Thanks in advance,

Marcin

2021-08-03_12h13_59.png
2021-08-03_12h19_42.png
Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi, I am having the exact same issue! 😥

  • mpilarczyk Profile Picture
    44 on at

    Not sure what we are doing wrong here as if it was a general bug, then I guess a lot of these topics would be created here...

  • KoenReynaert Profile Picture
    30 on at

    Same problem here!  

    Smaller case to reproduce:

    In same app putting two controls refering to same datasource.

    • Using a list control and refer .Items = datasource 'Dossiers' --> OK, I see the items to my SP list in my PRD tenant.
    • using a dropdown control and refer .Items = Choices(Dossiers.myChoiceField) --> Error "List not found".

    Using environment variable is working for my List control, but not when using Choices() in same app.

    KoenReynaert_1-1632776188018.png

     

    I see in the PowerApp Source overview that the SharePoint datasource is still referencing to the original SP Site URL.

    KoenReynaert_0-1632776065684.png

    But it works for eg my list control.

     

    This is a bug!  3 persons also reported this as reply on Reza's video: (82) Data Source Environment Variables in Power Platform Solutions - SharePoint - YouTube

     

     

     

     

  • mpilarczyk Profile Picture
    44 on at

    @KoenReynaert  @Anonymous Do you know how we can get Microsoft attention? As they might not be aware of this problem...

     

  • BenMunk Profile Picture
    114 on at

    I'm also seeing this bug...  

    1. Data Connection works for controls other than those with Choices()

    2. Hover the connection (as per your screenshot) - its showing the Dev sharepoint list, but...

    3. All working formulas are pulling in from Prod data source.

     

    This fix for me was to remove and re-add the data sources (via an environment variable)

  • mpilarczyk Profile Picture
    44 on at

    @BenMunk But if you are using managed solution then you are creating unmanaged layer which isn't what we want. 

  • michelcarlo Profile Picture
    66 on at

    I'm facing the same issue with Canvas apps, all good when the solution is imported except the choices function and also the fact that when we hover over the data sources on the canvas app it's displaying the original site and not the updated one on the destination environment. Did anyone find a way to sort this without having to re-add the connections (which also to me would be against the purpose of using solutions + the concept of managed solutions)?

  • marial16 Profile Picture
    443 on at

    I am facing the same issue.

    It is definitely a bug and there is no solution or workaround yet.

    I use SharePoint Lists to store data.

    I was wondering if using dataverse would solve the issue and if there are any limitations.

  • mpilarczyk Profile Picture
    44 on at

    For anyone interested - I have raised a ticket to Microsoft, they have replied that this is in fact known issue and they plan to deliver the fix till the end of January. 

     

    @marial16 

    I believe that this is connected with SharePoint as data source. I have used Dataverse in other projects and it wasn't causing any issues with Choices() expression.

    Workaround for this when using SharePoint would be to hardcode dropdown values within the app and in person/group type field to use O365Users Connector and create people picker on your own.

     

    Cheers

  • leksi31 Profile Picture
    35 on at

    Hi there!

     

    @mpilarczyk is there maybe something new about that issue? A hardcoding workaround is not an option for me so i am just waiting for it to be fixed... 

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#2
11manish Profile Picture

11manish 205 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard