I am modifying form for sharepoint list with Power apps. I want to define sharepoint list in my expression as the list that user is using in that moment.
I do not want to use a specific value (list name) because I will use the same expression for different projects. The name of my sharepoint list is "list1".
Currently I have:
Sort('list1', ID, Descending)).ID
How can I define a reference value for Sharepoint list in use instead of using its name ('list1' in my case)?
Hi @li88li ,
I'm not aware of any way to currently variabilise DataSource objects or their properties within an app. These assignments are absolute, unless you are using environment variables to define them across environments.
When alternate sources are used across environments, then the general practice is to package your app in a solution and allow PowerApps to generate environment variables for your data sources. These can be configured to connect to different sources across different environments.
This is however more of an application lifecycle function, (i.e. moving apps from DEV to UAT to PROD and so forth) - so I'm not sure this is what you're looking for as you would have to move the app between environments to use this function, but feel free to take a look and explore...
Announcing data source environment variables | Microsoft Power Apps
Kind regards,
RT
Hi @li88li ,
You cannot dynamically refer to elements such as list and field names dynamically in Power Apps, so you would need to hard-code it.
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.
Visit my blog Practical Power Apps
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional