cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Refering to sources stored in a Table

Hi,

 

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

 

 

Table(
{ 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? 

 

 

1 REPLY 1
Anonymous
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

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,232)