Search code examples
gallerypatchpowerappspowerapps-formula

Powerapps - Change gallery source and patch destination


I'm about to go mad about an issue in Powerapp.

I'm making an app, which will be used to count inventory in different locations.

I'm using a gallery to show the data from my Excel spreadsheet, and it works fine, if I choose the locations in the gallery settings menu.

However, I would like the text input field in the gallery to show the current value, from the location which I enter in the top text input field. I would also like to have the correct column PATCH when I press the arrow.

Does anybody know how I can make it happen?

Thanks in advance!

enter image description here

enter image description here

enter image description here


Solution

  • To display the column based on the input box text, set the 'Default' formula of the gallery input boxes to be:

    If(TextInput.Text = "Loc21", Loc21, TextInput.Text = "Loc22", Loc22, TextInput.Text = "Loc23", Loc23, TextInput.Text = "Loc24", Loc24, TextInput.Text = "Loc25", Loc25, TextInput.Text = "Loc26", Loc26)
    
    You can't update tables from a static data source such as Excel. You could however upload your data to a SharePoint site or Common Data Service and then use a [Patch](https://learn.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-patch) function to update the value in that new data source.