cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lefty
Impactful Individual
Impactful Individual

Loading collection at OnStart if submitted item

Hi,

Unsure if this can done, hopefully I will explain properly.

I have a collection of images being written to the attachment control to a SPO list.

On a gallery buttons OnSelect this code works fine and loads the item and the images for that item:

ClearCollect(
    colImages,
    ThisItem.Attachments);
Set(VarRecord,ThisItem);
Navigate(HomeScreen)

 

but if a user receives an email with the link to the item and deep linking is working but I am unable to load the items images associated with that item here is my code and struggling to make this work:

 

Set(VarID, Value(Param("MYID")));
If(VarID <> 0,Set(VarRecord, LookUp(ListName,ID = VarID)); 
ClearCollect(colImages,VarRecord.Attachments); //This part does not work, without it the item loads correctly
Navigate(HomeScreen));
1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Lefty 

Please consider changing your Formula to the following:

Set(VarID, Value(Param("MYID")));
If(VarID <> 0,Set(VarRecord, LookUp(ListName,ID = VarID)); 
ClearCollect(colImages, LookUp(ListName,ID = VarID).Attachments); //This part does not work, without it the item loads correctly
Navigate(HomeScreen));

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@Lefty 

Please consider changing your Formula to the following:

Set(VarID, Value(Param("MYID")));
If(VarID <> 0,Set(VarRecord, LookUp(ListName,ID = VarID)); 
ClearCollect(colImages, LookUp(ListName,ID = VarID).Attachments); //This part does not work, without it the item loads correctly
Navigate(HomeScreen));

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Lefty
Impactful Individual
Impactful Individual

HI @RandyHayes 

Perfect Thanks a million

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (1,809)