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

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (65,951)