cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mpilarczyk
Advocate I
Advocate I

Environment Variables and Choices() function issue

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

1 ACCEPTED SOLUTION

Accepted Solutions
PowerRanger
Super User
Super User

Microsoft is already deploying a fix to some customers as far as I am informed. Will take some time till it will reach all Tenant I guess. Actually all complex field Types are not working as expected. 




​Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item.

If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

25 REPLIES 25
Anonymous
Not applicable

Hi, I am having the exact same issue! 😥

mpilarczyk
Advocate I
Advocate I

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
Regular Visitor

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
Advocate I
Advocate I

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

 

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
Advocate I
Advocate I

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

michelcarlo
Advocate II
Advocate II

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)?

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
Advocate I
Advocate I

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

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,697)