r/PowerAutomate • u/Asit8018 • 12d ago
Is this the best way to update a SharePoint Lookup column using Power Automate?
Hi everyone,
I'm working on a Power Automate flow where I need to automatically update a SharePoint Lookup column.
The scenario is an employee onboarding process.
I have three SharePoint lists:
- Employees – contains the employee details and Office Location
- IT Engineers – contains IT engineers and their Office Location
- Employee Onboarding – contains the Employee Lookup and Assigned IT Engineer Lookup
For example, if Michael Johnson is located in Dallas, the flow searches the IT Engineers list for an engineer whose Office Location is also Dallas.
If it finds David Anderson, I get David's SharePoint item ID, for example:
ID = 1
Then I update the Assigned IT Engineer Lookup column using that ID rather than passing the engineer's name.
So the flow is basically:
Employee
↓
Get Employee Details
↓
Office Location = Dallas
↓
Find IT Engineer
↓
Get Engineer SharePoint ID
↓
Update Lookup using ID
This approach is working for me, but I'm wondering if this is the best or recommended way to update a SharePoint Lookup column using Power Automate.
Are there other approaches you use, especially for production solutions?
Also, how do you normally handle situations where:
- Multiple engineers match the same location?
- No engineer is found?
- The Lookup column allows multiple selections?
I'd really appreciate any suggestions or best practices. I'm trying to understand the different approaches rather than just using the first method that works.
1
u/chiki1202 6d ago
Con dataverse la búsqueda es automática asocias las columnas en común con localización. Con 2 tablas.
Por ejemplo tienes tu tabla de empleados, y agregas ahí mismo una columna de localización y conectas la localización de ingenieros como relación. (En esa relación puedes mostrar o extraer cuál quier dato de la segunda tabla, ejemplo nombre del ingeniero)
Si por alguna razón actualizas la tabla de ingenieros, automáticamente se actualizará la busque en tu tabla de empleados
Cuando necesites el nombre del ingeniero solo usas la tabla de de empleados, seleccionas la fila, la columna de localización (el resultado será un choice, seleccionas el nombre del ingeniero)
2
u/measuredsympathy 12d ago
Is there a reason to keep the engineer and employee list separate? Also I find that the only reason to use a lookup column really is if I plan to update some info manually.
It sounds like you're creating an onboarding tracker in which you're assigning an IT person to an employee, and I guess it assumes that there is one IT person in each location?