问题
In a SharePoint list, I have a column that holds a foreign key ID to another list. For example:
- list teachers
- list classes with foreign key column teacherID to teacher item
I am trying to create a Power Automate flow that starts with a SharePoint "For a selected item" in classes and then modifies the referenced teacher list item.
- "For selected item" in classes
- Modify teachers item referenced by classes.teacherID
All(!) I need to do is get the value of teacherID, but that has turned out to be incredibly difficult. How can I do this? I'm new to Power Automate so any suggestions appreciated.
What I've tried:
Created a second action to email me output from the first action (because I don't know any other way to "debug" or "watch" this). Added many different types of Dynamic content and expressions to the email body. teacherID never appears. It is not in the list of Dynamic content fields. I cannot find in expressions tried e.g.
triggerBody
,trigger
,output
,actions('For a selected item')
(which is an error for some unknown reason but I'm not trying to understand why at the moment). In the JSON, all I have been able to retrieve so far isID
,itemURL
,fileName
,FileId
(which looks the same as ID).My next thought was, okay, maybe "For a selected item" doesn't have access to the other list columns, but maybe "Get item" does. So, I inserted a "Get item" (singular, not "Get items) but this frustratingly did not make any difference.
What I am trying to do should be very simple and straightforward. The documentation is sparse, and it sucks TBH.
回答1:
If the lookup column name is teacherID, you should use teacherID Id in the flow to find the item in teachers
You could create the flow like this:
- "For a selected item" in classes
- "Get item" in classes
- "Update item" in teachers
来源:https://stackoverflow.com/questions/61139897/how-to-retrieve-value-in-selected-sharepoint-list-item-column