I have a form that is supposed to capture UPN of logged in employee. The field has code
Office365Users.MyProfile().UserPrincipalName as I want to capture the UPN of logged in user in form text field as defalut value that is not editable by user in form.
This field is not editable and my intention is to show UPN that is not changeable/ editable by user, when i run the form, it shows me my name in form field and enters my name in list using flow.
when some other user calls the flow it does not enter data in SharePoint list but i see their data values in flow. the error i received in flow is: The response is not in a JSON format. "
Below are forms and flow i am using to update sharepoint List.
Here is FLOW entry with user data
I just noticed that for every user the connection is my name
Could this be the reason of error?
If yes how to resolve it as to my understanding , this connection should be each users name? how to resolve this issue?
TIA
Sorry, I don't know how you would go about doing that, especially if its not the same user account that is logged into Power Automate Desktop.
@Pstork1 Hope you are doing well. I need some more help in getting informaiton of logged in user in Power automate Desktop .
I want to get the information of user's name/info ( such as full name, UPN) from window that is connected to Azure AD. Cna you help?
Thanks a lot. I really appreciate your cooperation.
As I mentioned previously. If WorkDate is a label then you are trying to use the label control as input for the Text function. That won't work. It needs to be WorkDate.Text.
@Pstork1 The date is label inface everything is label as it s only to view and data is entered on button click. I used this but i recieve same error.
TestFlow.Run(Name.Text,WorkTime.Text,Arrival.Text,Text(WorkDate,"[$-en-US]yyyy-MM-dd"),Email.Text)
Sorry i am very new to PowerApps and this is my first app. I appreciate your cooperation.
If Date is a label then you need to access the Text property of the label, not just Date.
TestFlow.Run(Name.Text,Email.Text,Arrival.Text,Text(Date.Text,"[$-en-US]yyyy-mm-dd"))
I would also avoid using Date as a label name since its a reserved word.
@Pstork1 I thought to redo form.
i have another scenerio, I need date and time for time sheet , i am trying to have only date and time in different Labels Say Date and time where
Date --> Text( Now(), DateTimeFormat.LongDate ) and
time is Text(Now(), "HH:mm AM/PM")
Now when i run flow it gives error Error details: 'String 'Tuesday, July 6,2021' does not validate against format 'date'.'." and flow is TestFlow.Run(Name.Text,Email.Text,Arrival.Text,Text(Date,"[$-en-US]yyyy-mm-dd"))
how to resolve this issue?
How are you using User().FullName that it shows the Full name of the maker of the app? It should pull the person running the app. Are Workdate and Time variables? That's probably the issue. Because those values when passed are strings and the fields you've put them in are expecting Date Time values. You'll probably need to cast them using FormatDateTime() in the flow.
@Pstork1 Thanks for responding to the post. I tried user() it displayed user email of logged in but user().FullName still shows the name of app creator.
this is run line to invoke the flow.
TimeSheetManagementFlow.Run(Label7.Text,WorkDate,Time,Arrival.Text)
where Label7 is User().Email
If what you want is the UPN of the logged in user then I would use User().Email rather than Office365Users.myProfile(). There is no guarantee that everyone has a profile.
Other than that can you show us the .run line you are using on the buttons to invoke the flow?