I have created with AccessWebApp an application on SharePoint, and since the announcement came that Microsoft will stop this service, I need to convert the app. to PowerApp with lists on SharePoint.
My problem is, that I have created an app with multiple views based on the "Order" template available in AccessWebApp. One of those feature was: when we click on the name of a person a pop-up view opened with the contact sheet of that person. Now I want to recreate the same feature in PowerApp.
The view for the contacts, has 3 levels.
1: 'BrowseScreen1' with a vertical Gallery containing a list of all contact persons,
2: 'DetailScreen1' with a form with only readable information of the contact selected in 'BrowseScreen1'
3: 'EditScreen1' with a modifiable form of the contact selected in 'BrowseScreen1'
I created a new view in the same app. for orders. It is also composed of 3 levels.
1: 'BrowseScreen2' with a vertical Gallery containing a list of all contact persons,
2: 'DetailScreen2' with a form with only readable information of the contact selected in 'BrowseScreen2'
3: 'EditScreen2' with a modifiable form of the contact selected in 'BrowseScreen2'
On 'DetailScreen2' I have a text box with the contact person, and what I want to do is: 'When I click on the contact name, I am sent to the 'DetailScreen1' for that specific contact.'
For this I know I have to put a code in the 'OnSelect' box in the advanced menu of that text box. I know that the code will start with: Navigate(DetailScreen1;...) but I don't know how the rest of the code will look like.
Can someone help me?
Greetings Mathieu Tahon
Hi @Tahon_Mathieu (please be careful as in my locale the syntax uses , instead of your ; and ; instead of your ;
I think you will find that in DetailScreen1, the controls will be bound to something like GalleryX.Selected.XXX where GalleryX is the name of the gallery in BrowseScreen1, and XXX is the field that you show in the control.
One way to make DetailScreen1 controls bind to different sources is to change the approach and load (i.e. ClearCollect) the selected contact record into a local collection. Then you can bind the controls in DetailScreen1 to the collection (i.e. First(MyCollection)) instead of GalleryX.Selected.
So the OnSelect for any button/text box etc. that points to DetailScreen1 should be something like:
ClearCollect(CurrentContact, XXX); Navigate(BrowseScreen1, None)
Where XXX depends on how you load the data, so in BrowseScreen1 your XXX will be ThisItem, and in DetailScreen2 XXX will be something like:
LookUp(ContactsList, ID = GalleryY.Selected.Contact_ID) where GalleryY is now the name of the gallery in BrowseScreen2.
Then in DetailScreen1, change all references from GalleryX.Selected to First(CurrentContact)
This should work, so please come back with any questions.
I tried your solution, I think it will work, but I cannot use it for the moment since the "ID" in 'ID = GalleryY.Selected. ...' is a calculated column in the list itself to bring together the first name and the last name. So I will have to look for a way to make the first- and last name visible on the 'DetailScreen2' that I will be able to use the formula you gave me.