Hi, I hope you experts can help me.
Is it possible to populate a lookup field in Sharepoint dynamically from data taken from an Email?
I have a flow working nicely initializing variables to take name, email address etc from a course application received in the body of an email. However I'm unable to populate one field (Staff ID) as in the Sharepoint list (Training Details) that field is a lookup from another list (Staff Details).
My only options to populate this field seems to be to select a Staff ID from the list (lookup) or to enter an expression.... I can't choose the variable I initialized for Staff ID for the text string in the application.
Any ideas how I can dynamically use the Staff ID in the application email and use that value to pick from the list of Staff IDs in the lookup field?
Many thanks Dave
Solved! Go to Solution.
Close 🤣
Have a look at the history of the create training record to see what data is being passed. Also, try creating a record with one of those ID's directly in the create training record step. Maybe the formatting is just not 100% and only by looking at the history will you be able to spot the difference. Feel free to share some screenshots of the history if you are not sure (input/out).
If I have understood, as part of your solution, could you not lookup the other list (Get Items with a Filter Query) for the staff name and therefore retrieve the ID of the lookup before saving the original item back to the list?
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien
P.S. take a look at my new blog here
Thanks for responding Damien.
I probably didn't explain it very well. If I was manually entering an item in the Training Details list I would need to select an existing Staff ID (looked up from the Staff List).... that would then link the training record to the staff record. In flow I want to take the Staff ID in the application email and force this into Staff ID field. Your suggestion may well help me but I wouldn't know how to implement it 😟
Dave
Maybe it's worth sharing a screenshot?
If you are just attempting to write an ID back to a lookup item, it works fine for me, so I am not sure if you are experiencing an error maybe that you can share?
If you only know the name and you want to find the ID, you need to use get items from the other list with a filter. Once you've obtained the ID, you can feed that back to create the item.
Many thanks I'll try this tomorrow morning. So if I understand you correctly I get items from my Staff List (unfiltered that would be thousands) but filter it to find the relevant Staff ID. I have a unique field I can use in my filter. Can I use the variable I initialized earlier in the flow in this filter statement? i.e. StaffID='StaffID'(variable created earlier).
Thanks Dave
Exactly that - use your variable from earlier in your filter. Good luck and let me know how you get on.
Close 🤣
Have a look at the history of the create training record to see what data is being passed. Also, try creating a record with one of those ID's directly in the create training record step. Maybe the formatting is just not 100% and only by looking at the history will you be able to spot the difference. Feel free to share some screenshots of the history if you are not sure (input/out).
Many thanks again Damien I'll give that a try sounds like a great approach!
Dave
Hi again Damien,
Thanks to your help I managed to get it working!
Where I was going wrong was I was trying to put the value of Staff ID into the field, rather than it's Id. Once I realised that and figured out how to dynamically find the Id it worked perfectly 😀
Many thanks for setting me on the right path.
Regards, Dave
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
67 | |
24 | |
16 | |
16 | |
13 |
User | Count |
---|---|
116 | |
35 | |
32 | |
28 | |
26 |