cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
opticshrew
Level: Powered On

Select a Data Source Using a Variable

Hi,

 

I have a PowerApp with a number of known and unknown data sources. By this I mean I have a SharePoint list named DS1 and will have more in the future.

 

I have a function that passes a value to a global variable that looks similar to this:

 

Set ( GlobalVar , "Table Name")

However when setting the data source for a gallery the variable is text and not linked to the connected data source.

 

Any ideas?

2 REPLIES 2
Super User
Super User

Re: Select a Data Source Using a Variable

Hi @opticshrew

 

Unfortunatley, it's not really possible to use a variable to store a data source.

 

This thread here provides some more discussion on this issue.

 

https://powerusers.microsoft.com/t5/General-Discussion/use-a-variable-as-a-datasource-in-a-function/...

 

 

opticshrew
Level: Powered On

Re: Select a Data Source Using a Variable

HI @timl

 

It is possible to store a data source as a variable as I've achieved it in the following:

 

Set(
    GlobalDataSource,
    Switch(
        DataSourceLookup,
        "RISU-LOG",
        'RISU-LOG'
    )

DataSourceLookup is a text variable storing "RISU-LOG". This isn't the solution I wanted though as it would require a manual code change if I were to add multiple data sources in the future.

 

Thanks,

Jay

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 203 members 4,474 guests
Please welcome our newest community members: