cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
btalk
Regular Visitor

Need help with transition from Browse Gallery to Detail Form

Hello!

 

I'm trying to make it so that when users click the next button on the contact gallery screen, it takes them to the details page for that contact. However, I would also like them to be able to click a button on the account screen to take them to the primary contact's detail screen and vice versa. I tried using OnSelect: Navigate('Detail Contact View',ScreenTransition.Fade,{displayItem:ThisItem}) on the next button in the gallery and contact button in the account detail view, but I get an error message that says, "Incompatible Type. We can't evaluate your formula because the context variable types are incompatible with the types of values in other places in your app."

 

(Reposting the pictures as .jpeg rather than .png)

 

Thank you in advance,

 

Bailey

 

9 REPLIES 9
Drrickryp
Super User II
Super User II

Hi @btalk,

 

I believe that the error message you are getting is because your context variable "displayItem:",  in the curly brackets is used twice in a different way in two different icons.  See if changing the name of the variable in one of your icons eliminates the error.  Let me know if that works.   

Hi @Drrickryp,

 

Thanks for your response! That took away the error message, but now the next button on the gallery screen doesn't work. Nothing happens when I click it. Is there a way to have multiple screens navigate to the same details page, that populates based on what the user clicked to get there?

Hi @btalk,

There are a number of ways to have a single target screen from many source screens and you don't always have to use a context variable in the Navigate Command.  An alternative would be to use a global variable using the Set() function. For example, Set( selectedid,ThisItem.ID);Navigate('Detail Contact View',ScreenTransition.Fade).  In your target, Detail Contact screen, Make the Items property of the Edit form: Lookup(Contacts,ID= selectedid). Likewise in your accounts screen.  The global variable "selectedid" will stay the same until you select another person in your gallery.  Check out the Set() function at https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-set for some examples of how it works.

Hi @Drrickryp,

 

I'm really sorry, I'm brand new to this. I put "Navigate('Detail Contact View',ScreenTransition.Fade);Set(selectedid,ThisItem.id)" under OnSelect for the next button then "LookUp(Contacts,contactid=selectedid)" in the Item field for the detail view, but I'm getting the same error before on the Gallery page and Invalid arguement type on the detail page.

No worries,  Could you tell me what data source you are using  (ie. Sharepoint list, Excel table, etc)  and if there is an ID column in it. I was assuming that you have an ID column your data source. 

To make it understandable, what we are trying to do is set a global variable from the gallery that you can use to identify the selected record that is being displayed in the Edit and View forms on different screens. This variable doesn't change until you pick a different record in the gallery.

My data source is Dynamics 365.

 

Thanks for explaining! That makes sense. I'm not sure if Dynamics has an ID that's consistent across accounts and contacts.

I'm not familiar with Dynamics 365 but lets test it.   If you select the viewform on the Contact Details screen, ilooking at the right hand side of the screen, click on fields and see if there a field called ID.

Master ID is the only ID field.

 

I set the next button to be OnSelect: "Navigate('Detail Contact View',ScreenTransition.Fade);Set(selectedid,ThisItem.masterid)"

I set the Item on the detial form to be: "LookUp(Contacts,selectedid=masterid)"

 

The next button doesn't work and the error on the detail form page says "Delegation warning. The highlighted part of this formula might not work correctly with the column "masterid" on large data sets. The data source might not be able to process the formula and might return an incomplete data set. Your application might not return correct results or behave correctly if the data set is incomplete."

 

Thanks again for all your help on this.

Hi @btalk,

I'm afraid that I don't know enough about Dynamics 365 as a data source to give you the help you need with this app.  Perhaps someone else more knowledgeable than I can get you further along.  Good luck though

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,044)