Add a button and attachment controls in the screen.

In Upload button write the code now.

First identify that any item is uploaded or not. It means here attachments control maintains a Table.

Say that attachments control name is: DataCardValue15_1.Attachments

Now use CountRows(DataCardValue15_1.Attachments) > 0 so that it will know that an attachment is uploaded.

Now use this:

(Right(First(DataCardValue15_1.Attachments).Name,5) = “.xlsx”)

Now in button write this complete code.

If(
  CountRows(DataCardValue15_1.Attachments) > 0 &&  (Right(First(DataCardValue15_1.Attachments).Name,5) = “.xlsx”),
Notify(
“Correct file”,
NotificationType.Success,
5000
),
Notify(
“Its not an excel”,
NotificationType.Error,
5000
)
)