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

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

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.


Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (7,616)