Lucky I had some time to spend on some mind-numbing code . . . if you really want to get all of that back to the format you want
If(
CountRows(SortedDates) >= 5,
With(
{
_DT1:
Split(
Left(
First(SortedDates).DateTime,
8
),
"/"
).Value,
_DT2:
Split(
Left(
Index(
SortedDates,
2
).DateTime,
8
),
"/"
).Value,
_DT3:
Split(
Left(
Index(
SortedDates,
3
).DateTime,
8
),
"/"
).Value,
_DT4:
Split(
Left(
Index(
SortedDates,
4
).DateTime,
8
),
"/"
).Value,
_DT5:
Split(
Left(
Last(SortedDates).DateTime,
8
),
"/"
).Value
},
With(
{
_Date1:
DateTimeValue(
Index(
_DT1,
2
).Value & "/" & First(_DT1).Value & "/" & "20" & Last(_DT1).Value & " " &
Mid(
First(SortedDates).DateTime,
10,
2
) & ":" &
Right(
First(SortedDates).DateTime,
2
)
),
_Date2:
DateTimeValue(
Index(
_DT2,
2
).Value & "/" & First(_DT2).Value & "/" & "20" & Last(_DT2).Value & " " &
Mid(
Index(
SortedDates,
2
).DateTime,
10,
2
) & ":" &
Right(
Index(
SortedDates,
2
).DateTime,
2
)
),
_Date3:
DateTimeValue(
Index(
_DT3,
2
).Value & "/" & First(_DT3).Value & "/" & "20" & Last(_DT3).Value & " " &
Mid(
Index(
SortedDates,
3
).DateTime,
10,
2
) & ":" &
Right(
Index(
SortedDates,
3
).DateTime,
2
)
),
_Date4:
DateTimeValue(
Index(
_DT4,
2
).Value & "/" & First(_DT4).Value & "/" & "20" & Last(_DT4).Value & " " &
Mid(
Index(
SortedDates,
4
).DateTime,
10,
2
) & ":" &
Right(
Index(
SortedDates,
4
).DateTime,
2
)
),
_Date5:
DateTimeValue(
Index(
_DT5,
2
).Value & "/" & First(_DT5).Value & "/" & "20" & Last(_DT5).Value & " " &
Mid(
Last(SortedDates).DateTime,
10,
2
) & ":" &
Right(
Last(SortedDates).DateTime,
2
)
)
},
With(
{
recordToSubmit:
{
TimeRaised: _Date1,
TimeAssigned: _Date2,
TimeStarted: _Date3,
NotesAdded: _Date4,
TimeCompleted: _Date5
}
},
Patch(
'CRM Priority (Do Not Use)',
Defaults('CRM Priority (Do Not Use)'),
recordToSubmit,
Form1.Updates
);
Notify(
"All dates submitted successfully!",
NotificationType.Success
);
ResetForm(Form1);
Reset(TextInput1)
)
)
),
Notify(
"Not enough dates to submit!",
NotificationType.Error
)
);
Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
MVP (Business Applications) Visit my blog Practical Power Apps Buy me a coffee