cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lefty
Post Prodigy
Post Prodigy

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 III
Super User III

@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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

2 REPLIES 2
RandyHayes
Super User III
Super User III

@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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

HI @RandyHayes 

Perfect Thanks a million

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

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

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (21,474)