cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
atagios
Frequent Visitor

Creating rows in a SharePoint List for a Lookup column with multiple Values

Hi 

I am trying to create a manual triggered flow that will create items From One SharePoint list A to another SharePoint list copyA (which is an exact copy of the first).

The list A  and list copyA have columns:

Title txt

Amount Number

TransDate Date

PrjTeam (Lookup Allow multiple values to another list “Empl”)

As can understand each row in list A, in the PrjTeam column has more than one value (the lookups from the list Empl)

My flow looks like this:

atagios_0-1644176796862.png

 

My problem is in the "Create item" step how to pass the values in the PrjTeam column that is a lookup one with multiple values:

atagios_1-1644176796865.png

 

I believe that it must be in an Array format, but I can not figure it out… can anyone please help?

1 ACCEPTED SOLUTION

Accepted Solutions
atagios
Frequent Visitor

Hi all,

After spending some time and several tests, I have found the way to handle it!

I am putting it down for any other that might looking for it, I hope it will help!

  • Initialize 2 (YES TWO array variables)
    1. One Empty Array (for clearing the main array of the lookup column array)
    2. The main array that will have the values of the lookup column
  • Then the get items step for getting the rows of the Initial Sp list

atagios_0-1644238616782.png

 

 

  • Apply to each step (for every row of the initial SP list, from the previous step)
  • In that Another Apply to each with input the LOOKUP COLUMN

atagios_1-1644238616789.png

 

  • Then an Append to array (here we are appending to the MAIN Array variable) as showing in the below picture:

atagios_2-1644238616793.png

 

As you can see the formula, we have to use is in the step note (you can find yours, if different, by using a compose step.

atagios_3-1644238616809.png

 

  • Then you put a create an item step for you Copy SP List and you make the selection of the fields appropriately.

 

In the lookup column you put the Main array variable

atagios_4-1644238616815.png

 

  • Finally you have to clear the array by using a set variable step by setting the Main Array variable to the Empty Array variable (that we initialized in the beginning of the flow

atagios_5-1644238616817.png

 

 

I hope it will help!

 

View solution in original post

3 REPLIES 3
abm
Super User
Super User

Hi @atagios 

 

I have made a tutorial video for this.

 

Power Automate - How To Update SharePoint Choice Column - YouTube

 

If you have any more questions please let me know.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
atagios
Frequent Visitor

Hi @abm 

Thank you for your replay,

I have seen your video, but what I can not figure out is how to append in the Array Variable the lookup column values that each row has (in the Apply to each step )

atagios_1-1644227908622.png

 

As can see in my case I already have an Apply to Each for every item of the Get Items Step

And the Column "PrjTeam" is a Lookup (with multiple values).

So I need to append to the Array the values that each item have, create that in the copyA list and "reset" the Array variable for the next item ? Is that correct ?

Any ideas?

Thanks

 

atagios
Frequent Visitor

Hi all,

After spending some time and several tests, I have found the way to handle it!

I am putting it down for any other that might looking for it, I hope it will help!

  • Initialize 2 (YES TWO array variables)
    1. One Empty Array (for clearing the main array of the lookup column array)
    2. The main array that will have the values of the lookup column
  • Then the get items step for getting the rows of the Initial Sp list

atagios_0-1644238616782.png

 

 

  • Apply to each step (for every row of the initial SP list, from the previous step)
  • In that Another Apply to each with input the LOOKUP COLUMN

atagios_1-1644238616789.png

 

  • Then an Append to array (here we are appending to the MAIN Array variable) as showing in the below picture:

atagios_2-1644238616793.png

 

As you can see the formula, we have to use is in the step note (you can find yours, if different, by using a compose step.

atagios_3-1644238616809.png

 

  • Then you put a create an item step for you Copy SP List and you make the selection of the fields appropriately.

 

In the lookup column you put the Main array variable

atagios_4-1644238616815.png

 

  • Finally you have to clear the array by using a set variable step by setting the Main Array variable to the Empty Array variable (that we initialized in the beginning of the flow

atagios_5-1644238616817.png

 

 

I hope it will help!

 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (3,986)