Hi all,
My first time posting on this great forum having been a lurker for some time.
There is an issue with a Power App that I have built that triggers a Power Automate flow. I’ll explain.
I have built a very basic form in PowerApps with 4 fields. One of these fields is an ‘Attach file’ control.
When a user clicks the Upload button a workflow is triggered that moves the submitted form and attachment to a designated SharePoint list. Depending on which area of the business they selected on the form (‘select area’ dropdown), is where the form entry will sit, fine so far.
I will add that there is also a hidden text field within a card in Power Apps that changes the name of the document to be uploaded to SharePoint, so all documents have a similar naming convention no matter what the name of the document is.
PowerApps name change code is shown below:
IfError(
Office365Users.UserProfileV2(DataCardValue2.Selected.Email).surname & ", " & Office365Users.UserProfileV2(DataCardValue2.Selected.Email).givenName & ", Employee Form " & If(
Month(Now()) > 6,
Year(Now()),
Year(Now()) - 1
) & Text(
Now(),
"-mm-dd - hh:mm:ss"
) & "." & Last(
Split(
First(FileAttachments.Attachments).Name,
"."
)
).Value,
""
)
Workflow:

This flow works fine except….
….when the flow is run, and the Power Apps form is loaded into its designated SharePoint list, on clicking the attached document within the list row, I receive this error.

Just for further information, here is one of the 10 cases from the 'Switch' (ive had to block some naming out due to confidentiality)

Help! I've spent hours searching for solutions for this error but have come across nothing so far that matches this exact issue. I can delve in a little more if required. Thanks so much.