web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Create multiple items ...
Power Automate
Answered

Create multiple items in a SharePoint list based on two other lists

(0) ShareShare
ReportReport
Posted on by 92

Dear All, 

I'm still new to using Power Automate, so far I've been working in SharePoint Designer.
I would like to ask for help in how to put together the following process.


There are four lists that can be found on the same site:

JobPosition(JP): provides DepartmentPosition values for ER.Position and TV.Position lookup fields
EmployeeRegister(ER): contains data related to hiring a new employee
Task Vault(TV): contains task definitions
Checklist (CL): contains the data of the element created in the ER list and the elements created based on the elements of the corresponding TV list


The process:
1. A new record is created in the ER list
2. Based on the ER.Positon lookup (single select) field, search for all relevant TV elements based on the TV.Position (multiselect) lookup field
3. Iterate over TV list and if there is a value in the TV.Position lookup field that matches the value of the ER.Position lookup field, then create an element in the CL list

 

Unfortunately, I'm already stuck at the 2nd point. How do I iterate through the elements of the TV list and look for the ER.Position value in the TV.Position lookup field?

 

Here are a picture about the lists and the wished content in CL. Could you help me in this issue, please? Thank you!

er02.png

Categories:
I have the same question (0)
  • Verified answer
    v-jefferni Profile Picture
    on at

    Hi @GabrielN ,

     

    It just so happened that I had a few lists for testing that had almost the same structure as your lists:

    vjefferni_0-1661416762479.png

     

    so I tested and made a flow for your reference:

    Overview:

    vjefferni_1-1661416778891.png

    Detailed actions:

    vjefferni_2-1661416805160.pngvjefferni_3-1661416813592.pngvjefferni_4-1661416821467.png

    You can set Value to:

    {

     "Task": items('Apply to each 2')?['Title'],

     "Description": items('Apply to each 2')?['Description']

    }

    vjefferni_6-1661417469801.png

     

    So the basic logic is to 1.looping on all tasks 2.looping on all positions of each task and check if is equal to the position from employee's creation. 3. if yes, then this task is what you need, append the task and description to the array variable. 4. looping on the final array variable and create new items in the Checklist.

     

    Best regards,

  • GabrielN Profile Picture
    92 on at

    Hi @v-jefferni ,

    I am very grateful for your help! 👏 I will try your solution soon and give you a feedback!

  • GabrielN Profile Picture
    92 on at

    Thanks again for your help. The workflow was compiled successfully and the items are created in CL list.

    Here are the related steps:

    GabrielN_0-1661693639975.png

    All I needed to do was change the spaces in the name of the loop to "_" characters, because otherwise the workflow check threw an error:

    GabrielN_3-1661695506621.png

    After running the workflow by creating new item in ER list, the new items are created in CL list:

    GabrielN_1-1661697114363.png

     

    Thank you for your support again! 

     

     

     

  • cripcrop Profile Picture
    2 on at

    Hi, I wonder if either of you on this thread can help.

    Im trying to do the same as here

    I have created several sharepoint lists, attached.

    cripcrop_0-1676907997870.png

     

    I want to be able to add an ‘employee name’ and ‘machine’ to the ‘Employee generate training’ table and for it use power automate to go the the ‘machine skills’ table, pull out the ‘machine skills’ related to the chosen ‘machine’ and then populate the ‘Training’ table with all the skills for that machine and that user. eg there might be 31 skills for a particular machine, so it will create 31 rows of skills for that employee name.

    I used this page and followed that – but I keep getting an error, as I think im perhaps choosing the wrong value in my condition. See Error in last screenshot

    Thanks

     

    Chris

     

    cripcrop_1-1676908024607.pngcripcrop_2-1676908034274.png

     

    cripcrop_3-1676908038419.pngcripcrop_4-1676908042824.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard