cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mrstian89
Helper III
Helper III

Choose source based on a variable

Hi!
I have an app to keep track of equipment and loans on my work location.

I use two lists in Sharepoint to do this:

  • Equipment list
  • Equipment rental log list

In my company we have several locations which this could be useful.

 

This is part of the code I use to get information from a list:

 

SortByColumns(Search('SHAREPOINT LIST', SearchItems.Text, "Title", "Category", "ItemNo"),"Category",If(SortDescending1, Descending, Ascending))

 

 

Is there any way to change the data source 'SHAREPOINT LIST' using a variable?

I have tried the easy ways by making a global variable with the same name as the list, tried making a table and using the table. But no luck.

 

Lets say I have 20 locations which want to use the same app, but they do not want to use the same lists.
Is there any way to make this a simple solution using variables?

1 ACCEPTED SOLUTION

Accepted Solutions
StalinPonnusamy
Super User
Super User

Hi @mrstian89 

 

Example-Based on the team or input collect the data from a different lists and assign the collection to Gallery

StalinPonnusamy_1-1632969501877.png

StalinPonnusamy_2-1632969515582.png

StalinPonnusamy_3-1632969533122.png

 

 

 

View solution in original post

4 REPLIES 4
StalinPonnusamy
Super User
Super User

Hi @mrstian89 

 

We can't dynamically change the data source. The solution is to Collect the data to Collection and Assign the collection to Gallery in PowerApps.

 

  • Make sure all data sources should be the same. It means the when you collect the data from the different lists make sure the name and type are the same in the collection
  • Assign the collection to Gallery or Form in PowerApps.
StalinPonnusamy
Super User
Super User

Hi @mrstian89 

 

Example-Based on the team or input collect the data from a different lists and assign the collection to Gallery

StalinPonnusamy_1-1632969501877.png

StalinPonnusamy_2-1632969515582.png

StalinPonnusamy_3-1632969533122.png

 

 

 

Thanks! Thats seems to do the trick! 🙂
A couple of issues / questions:

 

  • Not all columns in Sharepoint are transferred to the Collection. For instance BarcodeValue which I depend on here. This columns shows up in the regular Sharepoint list, but if I go to list settings, it does not show under "Columns". Any ideas?
  • I have a column named: LastBorrowMail. This turned into some weird name in the Collection, and I can see it corresponds with "the real name" in the Sharepoint list. Any way to change "the real name" in the list?
StalinPonnusamy
Super User
Super User

Hi @mrstian89 

 

1. System fields may not show up. Is the BarcodeValue is a custom field right?. All columns should be in the list settings but the view we are looking at may not show the column.

 

2. We can change the display name but not the schema name. The best practice to create a column in Sharepoint is "create a column without space and any special char". Once created change the display name with space.

 

We need to create a new field and migrate the data since we can't change the schema name.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,175)