Showing results for 
Search instead for 
Did you mean: 
Not applicable

Refering to sources stored in a Table



I save mye SharePoint list sources in a table like this:



{ Text: "Option1", Screen: 'GeneralScreen', Source: SharePointList_Source_1 },
{ Text: "Option2", Screen: GeneralScreen, Source: SharePointList_Source_2 })

They both are going to be presentet on the same screen in a datatable. Which works fine.



I also have an GenerealAddScreen where i have some InputFields which both sources have in common and that I wish to use to update the SharePoint list. Here I use the Patch function:


//The DatabaseGallery is the table I have the sources from abow.
//The GenerallGallery is the gallery that present the rows in the selected sharepoint list.
Patch(DatabaseGallery.Selected.Source, {ID:GeneralGallery.Selected.ID}, {Status: StatusInput.Text}, {Dimension: DimensionInput.Text}, {Signed_x0020_By: SignedInput.Text}, {Signhist: GeneralGallery.Selected.Signhist & "," & SignedInput.Text}, {Statushist: GeneralGallery.Selected.Statushist & "," & StatusInput.Text}, {Datehist: GeneralGallery.Selected.Datehist & "," & DateInput.SelectedDate}, {Comment_Mod_Hist: GeneralGallery.Selected.Comment_Mod_Hist & "#" & CommentInput.Text} ); Refresh(DatabaseGallery.Selected.Source); Navigate(GeneralDetailScreen,Fade)
//The DetailScreen is just a Screen I use to show more information about a selected row from GeneralGallery

This code starts onSelect on a Button I have in the GeneralAddScreen, but I get the error that the datasource supplied is invalid. I know that all my datafields that I try to update excists in both Sharepoint list, and they use the same names. 


I have tried to change the source to direcly refer to SharePointList_Source_1 or 2, and that works fine! I have also checked that the selected values changes then i choose differently in the DatabaseGallery, so it is refering to the same source as if i just wrote SharePointList_Source_1!..



Does anybody know why this don't work? 



Not applicable

Re: Refering to sources stored in a Table

Got i to work now, but it is stupid and should be fixed!


Set(Variable,{Name: "one" , Source: SharePointList_Source})


If i try to use the variable to get to the datasoruce : Variable.Source -> It wont work!

BUT if i make an if statement : if(Variable.Name = "one", SharePointList_Source) -> it works fine


So I have to make a direct refrence to the source for it to work.

Helpful resources


Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!


Community Highlights

Check out whats happening in Power Apps


Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!


Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,200)