Hello!
Sorry for my English.
There are SharePoint lists with devices and repair dates.
Devices:
| ID | DeviceTitle |
------------------------------
| 1 | dev1 |
| 2 | dev2 |
------------------------------
Repair
| ID | DeviceID | DateOfRepair |
----------------------------------------------------
| 1 | 1 | DateTimeValue1 |
| 2 | 1 | DateTimeValue1 |
I need to get a collection where the last repair date is selected for each device.
I take two steps:
ClearCollect( DeviceReps; GroupBy( Repair; "DeviceId"; "Attestations" ));;
ClearCollect( LastRepDate; AddColumns( DeviceReps ; "MaxDate"; Max( Repair; DateOfRepair ) ) )
I get a collection DeviceReps:
| DeviceID | MaxDate |
-------------------------------------
| 1 | 1528664400000 |
| 1 | 1550700000000 |
How to get DateTime from 1528664400000? Or another way?
Thanks!
Solved! Go to Solution.
Max is going to return a number. Converting that back to a date is a challenge.
Here's another option to consider:
ClearCollect( LastRepDate;
AddColumns( DeviceReps ;
"MaxDate";
First(Sort( Repair; DateOfRepair; Descending)).DateOfRepair
)
)
This will sort the dates most recent being first and then take that first value of the DateOfRepair for your Column value.
I hope this is helpful for you.
Max is going to return a number. Converting that back to a date is a challenge.
Here's another option to consider:
ClearCollect( LastRepDate;
AddColumns( DeviceReps ;
"MaxDate";
First(Sort( Repair; DateOfRepair; Descending)).DateOfRepair
)
)
This will sort the dates most recent being first and then take that first value of the DateOfRepair for your Column value.
I hope this is helpful for you.
Hi Randy,
Could you please inform whether this can be used with "UI Flow (Preview)" of "Power Automate" to "Click" on the "Latest Date" in a "Website Table" or not?
I have a table with 8 columns and multiple rows.
In 5th column I have dates.
In 3rd column I have hyperlink.
Can we click on a hyperlink (2nd column) whose date is the highest (5th column)?
Thanks in advance.
Regards,
SK
Thks, Simple and elegant solution.
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
203 | |
187 | |
82 | |
50 | |
37 |
User | Count |
---|---|
290 | |
243 | |
123 | |
74 | |
54 |