cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mcolbert
Advocate V
Advocate V

Create Item in SharePointList Dynamically Set Value for Lookup

I have a SPO site, that has two lists. One has a list of projects, the other is a list of weekly update for the project. I want to build a flow that inserts new weekly updates for each project and sends an email to the owner to complete the information for the weekly update.

 

My intended flow is to query the projects in the first list, then loop through all projects creating an item in the second list. The second list has a lookup back to the first list that is a required field.

 

I am having a challenge determining how to populate the value for the field linked to the project list. If I do a manual update using the create item action, the values for the project are provided in a dropdown to select from and the item is generated correctly. However, I need the project to be dynamic, provided by the current item in the apply for each loop. 

 

I've tried both the sharepoint create item and the http post using sharepoint api and can't seem to get the syntax correct for providing the value for this project column.

 

Any assistance is greatly appreciated.

 

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yiwenxie-msft
Microsoft
Microsoft

Hi @mcolbert 

 

It seems like you run into a problem of filling in a lookup column with dynamic content.

If I’ve misunderstood your need, please feel free to let me know.

 

Actually, even though you can choose a choice from the drop-down to fill in a lookup column manually using ‘Create item’ as below:

3.5-5.png

 

The content filled in the lookup column is the ID linked back to the primary list, not the display content of one of the choice, such as ‘option2-category2’.

 

For example, my primary list is ’test1’ and my secondary list is ‘test2’. The lookup column get info from ‘test1’ in the ‘option-category’ column.

3.5-6.PNG3.5-7.PNG

 

So if I want to input dynamic content in the lookup column of ‘test2’, I should use the relative ID in ‘test1’.

I should choose ‘Enter custom value’ in the drop-down and use the dynamic content ‘ID’ which comes from ‘test1’.

3.5-8.PNG

 

If you still have the problem, please feel free to let me know.

 

Best Regards,
Community Support Team _ Kira Xie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yiwenxie-msft
Microsoft
Microsoft

Hi @mcolbert 

 

It seems like you run into a problem of filling in a lookup column with dynamic content.

If I’ve misunderstood your need, please feel free to let me know.

 

Actually, even though you can choose a choice from the drop-down to fill in a lookup column manually using ‘Create item’ as below:

3.5-5.png

 

The content filled in the lookup column is the ID linked back to the primary list, not the display content of one of the choice, such as ‘option2-category2’.

 

For example, my primary list is ’test1’ and my secondary list is ‘test2’. The lookup column get info from ‘test1’ in the ‘option-category’ column.

3.5-6.PNG3.5-7.PNG

 

So if I want to input dynamic content in the lookup column of ‘test2’, I should use the relative ID in ‘test1’.

I should choose ‘Enter custom value’ in the drop-down and use the dynamic content ‘ID’ which comes from ‘test1’.

3.5-8.PNG

 

If you still have the problem, please feel free to let me know.

 

Best Regards,
Community Support Team _ Kira Xie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Kudoed Authors
Users online (3,335)