web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Using a variable as a ...
Power Apps
Unanswered

Using a variable as a data source

(0) ShareShare
ReportReport
Posted on by 440
Hi everyone and Happy New Year, thanks to all the guy's on here who have not only helped me out but helped everyone else.
 
My issue is around using a variable (gblDataSource1) as a data source. There are a few threads where I have experimented in making a template and many thanks to @scalca for pointing me in the right direction. 
 
I have set up my template app and it works in terms of me being able to use it with numerous different data sources. The problem I am no faced with is that I want to add a NewForm control. When adding an EditForm to the app, the datasource variable is not available to direct the form to. I have overcome this on a ViewForm control and a gallery, however, I am struggling to set the form up to create a new form to submit information to the SharePoint list. When I try to link to the data, it only shows actual data sources and not the variable. Therefore, when I change the Data Source the link will be broken again 
 
I have the same question (0)
  • WarrenBelz Profile Picture
    153,745 Most Valuable Professional on at
    Two things, if you want to use a Form, the DataSource must be an actual "external" (SharePoint, Dataverse) List/Table - it will not work otherwise. Also if you want to use a "local" Table as a source, updating from individual controls or a Gallery, use a Collection (rather than a Table Variable) - it is much easier to update.
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn   
     
     
  • nshaw75 Profile Picture
    440 on at
    Hi @WarrenBelz, Thanks for the reply. I am now looking at using collections especially for the Combo Boxes. My original issue was that I was creating an app which can be easily duplicated for each project we undertake and having to go through each control on each form to change the data source. Having it as a variable and then using collections will at least the data source will only need changing in the OnStart property.
     
    Thanks for the pointers 
  • RobElliott Profile Picture
    10,391 Super User 2026 Season 1 on at
    You would only need to change the data source for the form itself, not for each individual control in it.
     
    Rob
    Los Gallardos
    Microsoft Power Automate Community Super User.
    Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)
  • nshaw75 Profile Picture
    440 on at
    Hi @RobElliot,
     
    Thanks very much for the reply. I don't know if it is because my app was too complex but when I would simply change the Data Source for the App, there were so red crosses appear it was easier to rebuild the entire form than to go through and redirect all the controls. I had found info and help on here where someone suggested I used environmental variables. These worked fine, the only issue is we can only make use of one environment and therefore the methods suggested didn't work. Again I have been shown that using variables in  the OnStart property would work. I have got this working, only for the gallery and ViewForm experience. Now I want to have a NewForm to create new entries I am coming up against issues again. I am a bit of a noob but am getting by, bit by bit, just need a breakthrough which I got this morning on one part, just need to be able to deliver the whole thing.
  • nshaw75 Profile Picture
    440 on at
    A very partial success, whereby I have created a small form, which when I Submit creates a new row in y SharePoint table, however for some reason none of the information from the form moves over. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 211 Super User 2026 Season 1

#3
VASANTH KUMAR BALMADI Profile Picture

VASANTH KUMAR BALMADI 195

Last 30 days Overall leaderboard