cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Paul_Cbl
New Member

Attachments get lost when passed to a context variable

Hi,

I have an application with two screens. The first screen shows a gallery of items retrieved from a SharePoint list.

The second screen shows details of the selected item in the first screen.

 

In the first screen, I can access the attached files for the row just fine (accessing First(ThisItem.Attachments).AbsoluteURI works just fine for example.

Now when I navigate to the second screen like so: 

Navigate(ItemDetails; ScreenTransition.Cover; {selectedItem: ThisItem});;​
I can access all properties of `selectedItem`, except for the Attachments. PowerApps behaves as if this property didn't exist at all on selectedItem.
 
Why does this happen? What do you think is the best solution to access the attachments on a second screen?
 
Thank you
1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @Paul_Cbl ,

 

Yes, the Attachment field can't be saved in Variable or Collection, please reference it directly from the SharePoint list. The solution is save the selected item ID to the variable, and use LookUp function to retrieve the record.attachments field based on the ID.

 

Navigate(ItemDetails; ScreenTransition.Cover; {selectedItemID: ThisItem.ID});;​
First(LookUp('SP list', ID=selectedItemID).Attachments).DisplayName

Hope this helps.

Sik

View solution in original post

1 REPLY 1
v-siky-msft
Community Support
Community Support

Hi @Paul_Cbl ,

 

Yes, the Attachment field can't be saved in Variable or Collection, please reference it directly from the SharePoint list. The solution is save the selected item ID to the variable, and use LookUp function to retrieve the record.attachments field based on the ID.

 

Navigate(ItemDetails; ScreenTransition.Cover; {selectedItemID: ThisItem.ID});;​
First(LookUp('SP list', ID=selectedItemID).Attachments).DisplayName

Hope this helps.

Sik

View solution in original post

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 (1,632)