Forum Discussion
Retrieve Employee AD Job Title to SP List
- Aug 24, 2023
Phishdawg No, it will not cause any functional conflict and Job Title will be saved in the list without any issue.
In the first formula I suggested to add in App.OnStart only fetches the currently logged in user's information from Office 365 connector. So, it will not conflict with the 2nd formula.
By default in Power Apps, formulas run in the sequential manner. So, first it will fetch the user information from Office 365 connector and then it will check if user is available in the SharePoint list or not - and then add user information to SharePoint list. Try it once and let me know if you face any issues.
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
Will this cause a functional conflict, causing one of both not to work due to the proximity to each other?
Phishdawg No, it will not cause any functional conflict and Job Title will be saved in the list without any issue.
In the first formula I suggested to add in App.OnStart only fetches the currently logged in user's information from Office 365 connector. So, it will not conflict with the 2nd formula.
By default in Power Apps, formulas run in the sequential manner. So, first it will fetch the user information from Office 365 connector and then it will check if user is available in the SharePoint list or not - and then add user information to SharePoint list. Try it once and let me know if you face any issues.
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
- PhishdawgAug 24, 2023Brass ContributorI have an 'EmployeeRole' (Choice) column in the 'Roles List'.
I need this to auto-populate with one of for 'Roles', that will be used to control employee access and filtering.
I'm thinking of changing the column to a Text column and sending that information with the 'OnStart' formula.
Can I add an 'EmployeeRole' to the 'OnStart' formula and use an If statement to determine what is populated?
If("Manager" || "Supervisor" in gvUserObj, "Manager","User")- ganeshsanapAug 25, 2023MVP
Phishdawg Something like this should work in case of text column:
Patch( 'Request List Admin', Defaults('Request List Admin'), { EmployeeName: { '@odata.type':"Micorsoft.Azure.Connectors.SharePoint.SPListExpandedUser", Claims: "i:0#.f|membership|"& varLoggedInUser.Email, Department: "", DisplayName: varLoggedInUser.FullName, Email: varLoggedInUser.Email, JobTitle: "", Picture: "" }, JobTitle: gvUserObj.jobTitle, EmployeeRole: If("Manager" in gvUserObj.jobTitle || "Supervisor" in gvUserObj.jobTitle,"Manager","User") } )
Please consider giving a Like if my post helped you in any way.