Reputation: 1
Can anyone tell me why this piece of code is loading the newest item (I do not want this) and the correct ID item (this is what I want to load) into my gallery. And maybe how do I get it to stop loading the newest item?
This is only happening when I click on the deep link in the email produced by PowerApps. Not when I load the app and click on an item from my dashboard gallery to load.
How I am understanding the code to read is: filter this gallery with lead_history information where the LeadID column equals the selected id from Gallery_Dashboard OR where the LeadID column equals the parameter passed in the URL called ID.
SortByColumns(
Filter(
Lead_History,
Or(
LeadID = Gallery_Dashboard.Selected.ID,
LeadID = Value(Param("ID")))
),
"HistoryDate",
SortOrder.Descending
)
More details:
App onStart:
If(!IsBlank(Param("ID")), Set(varRecordToOpen,First(Filter(Lead_Data,ID=Value(Param("ID"))))));
Timer on the screen that first loads:
Duration:
600
OnTimerEnd:
If(!IsBlank(Param("ID")),Navigate(Edit, Cover,{LoadLead:LookUp(Lead_Data, ID = Value(Param("ID"))), LoadHistory:LookUp(Lead_History, LeadID = Value(Param("ID")))}));
Edit Screen
Edit Form - Item:
varRecordToOpen
Gallery - Items:
Filter(
Lead_History,
Or(
LeadID = Gallery_Dashboard.Selected.ID,
LeadID = Value(Param("ID")))
),
"HistoryDate",
SortOrder.Descending
)
I think this is all the code that I am using to make this deep link work.
Upvotes: 0
Views: 656
Reputation: 150
From what I can see you have no condition in your OR
statement. So what makes the app choose between LeadID = Gallery_Dashboard.Selected.ID OR LeadID = Value(Param("ID")
?
I think that is the problem here.
Upvotes: 0