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
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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (69,578)