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

Get values for a selected item in a previous screen

I have sharepoint list which contains tickets.  PowerApps has built me an app from that list and I now have a browse screen to view the tickets, and selecting a ticket takes me to a detail screen where more information about that specific ticket is displayed.

 

Now, on the detail screen I can see that PowerApps created a form that contains the ticket detail fields.  And the data context of that form is set as follows:

bh4017_0-1624364772583.png


So I can see that the form data source is set to the associated sharepoint list and the specific item is referenced via the selected item on the browse gallery from the browse screen.

Inside the form there are datacards and these contain the ticket detail items.

 

bh4017_1-1624365076437.png


So here is where I start to lose some understanding.  The datacards contain a key item and a value item, with the key being the name of the item and the value is obviously the value contained in that item. In the above screen grab I have selected the value item to see how it fetches my name from the dataset.  And now some questions:

  1. How does the Choices([@Tickets].Assignedto) formula work? And how can I find out what it is returning?
  2. Inside the data tab itself I can see the Primary text is set to DisplayName so the datacard somehow knows that this item is a person type with a name and an email etc.  What is going on here?

Now, my end goal here is actually to get at that Assignedto data for my own purposes.  The only way I've found is to use the Browse gallery like this: BrowseGallery.Selected.'Assigned To'.DisplayName.  This actually works, but I feel like I'm fudging it and that there should be a way to get at the item from within the Details page itself.

If anyone has advice it will be welcome.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

Assignedto is a lookup field.  Choices() loads all the potential values of the lookup.  See here: Choices function in Power Apps - Power Apps | Microsoft Docs

But in general its not a good practice to try to get the values from the display form.  Normally the better way to do it would be like you are now.  Reference the Selected record in the gallery and access the actual value directly.  That is what the data card is bound to.  Its that binding that is used to fill in the DisplayName in the field in the form.  So using the selected record directly is actually more efficient.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
Pstork1
Dual Super User III
Dual Super User III

Assignedto is a lookup field.  Choices() loads all the potential values of the lookup.  See here: Choices function in Power Apps - Power Apps | Microsoft Docs

But in general its not a good practice to try to get the values from the display form.  Normally the better way to do it would be like you are now.  Reference the Selected record in the gallery and access the actual value directly.  That is what the data card is bound to.  Its that binding that is used to fill in the DisplayName in the field in the form.  So using the selected record directly is actually more efficient.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

bh4017
Regular Visitor

Thanks for your kind advice @Pstork1 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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