Hello all,
I wanted a text label to show the latest description from the SP List which are currently based from one status, activity type and Ticket ID. My current formula works fine, but it shown the first entry for the selected Ticket ID. For example I have three rows for the current Ticket ID, but it will only shown the first/oldest one in the list.
How do I get the latest/new entry from the SP list based from the condition stated in the below formula?
If(LookUp(Ticket, ID = displayItem.ID).Status.Value = "Resolved", LookUp(Activity, 'Activity Type'.Value = "Resolution" && 'Ticket ID' = displayItem.ID).Description, "No resolution is available.")
Any help is greatly appreciated as always. Thank you!
Solved! Go to Solution.
I have fixed the issue for this and thanks again @Drrickryp for the clarification.
Turns out I misplaced sort function and used Created Date to display the latest order.
LookUp(Sort(Activity, Created, Descending),'Activity Type'.Value = "Resolution" && 'Ticket ID' = displayItem.ID).Description
Thanks.
Hi @anonymia25
Lookup will always find the first record that matches the criteria. Since SharePoint, assigns a hidden sequential ID to every record, to obtain the latest one, sort the table by ID, Descending before applying the Lookup().
Hi @Drrickryp ,
Thank you for the clarification, I have tried placing the sort function in my formula but it showed error. Not sure if its the correct way to place sort but I appreciate the help to guide me on this. Thanks.
If(LookUp(Ticket, ID = displayItem.ID).Status.Value = "Resolved", SortByColumns(LookUp(Activity, 'Activity Type'.Value = "Resolution" && 'Ticket ID' = displayItem.ID).Description, "No resolution is available."), Activity.'Ticket ID', Descending)
I have fixed the issue for this and thanks again @Drrickryp for the clarification.
Turns out I misplaced sort function and used Created Date to display the latest order.
LookUp(Sort(Activity, Created, Descending),'Activity Type'.Value = "Resolution" && 'Ticket ID' = displayItem.ID).Description
Thanks.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
185 | |
47 | |
46 | |
34 | |
33 |
User | Count |
---|---|
256 | |
86 | |
79 | |
68 | |
67 |