I have a canvas app connected to a SPO list. I have a welcome screen as the first screen that lets the user select a navigation based on if they want to create a new item, search a gallery of all existing items, or edit a known item in the SPO list. The first two are very straight forward and work fine. I'm having trouble using the one FORM screen to edit an item selected from the gallery screen, or edit a known item based on the item ID. The navigation isn't the problem. How to use the same FORM to either edit an item selected from the gallery or edit an item based on the input from an textinput box is the problem.
I'm probably doing this all wrong, but this is what I've got so far.
In the WELCOME screen I have for the OnSelect for the navigation of the EDIT button:
Set(_formNavigation, true);ClearCollect(TTItem, LookUp('TT', ID = 'Edit-TextInput'.Text));EditForm(EditForm1);Navigate(EditScreen, ScreenTransition.None)
Other than a delegation warning, this formal has no errors.
For the navigation of the search gallery button, this:
Set(_formNavigation, false);Navigate(BrowseScreen,ScreenTransition.None)
The BrowseScreen works like a normal browsescreen.
The trouble I'm having is with the editform screen.
The EditForm1 properties are:
DataSource = If(_formNavigation = false, [@'TT'], _formNavigation = true, [@'TTItem'])
Item = TTGallery.Selected
Item currently shows an error because of the confusion from the DataSource. I'm struggling to write the formula for the Item property so that it either uses the item from the Gallery Selected or from the collection for TTItem (TTItem is based off of the user knowing a specific SPO item ID).
I have tried this formula for the Item property for EditForm1:
If(_formNavigation = false, TroubleGallery.Selected, _formNavigation = true, TroubleTicketItem)
but there is an error with it.
Is this even possible?
I'm sure I could create another edit screen and set the data source for one or the other, but I was hoping to limit the number of screens
Any and all help appreciated!