cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
paf169
Level: Power Up

Copy an item from one list to another within a SharePoint site based on condition or updated state

Action required
When an item has the column Status changing condition from 'Not approved' to 'Approved' in List#1  the following three columns should be created for a new item in List#2: Area, Specification-ID#, Specification
If for some reason the column Specification is updated for an item in List#1, the item in List#2 must be updated accordingly instead of creating a new one.
 
That should give a logic which looks something like this
if Status (List#1) = Approved
    if Specification-ID# (List#2) exist
          if Specification (List#1) <> Specifiction (List#2)
                  copy Specification (List#1) to Specifiction (List#2)
    else
          create new item in List#2 with the following columns from List#1
                  Area
                  Specification-ID#
                  Specification
 
Flow needs to run the conditional check of Status until all items in List#1 have been processed.
 
Should be pretty straightforward, but I'm having av hard time figuring out the Micosoft Flow syntax.
Been looking around, but have yet to find anything that solves this specific kind of flow.
 
Ideas anyone?
3 REPLIES 3
Super User
Super User

Re: Copy an item from one list to another within a SharePoint site based on condition or updated sta

Have you tried a list item modified triggered followed by a number of condition steps and within the condition a create item?

paf169
Level: Power Up

Re: Copy an item from one list to another within a SharePoint site based on condition or updated sta

Tried a couple of 'copy of item'.

 

The latest one gave me the following feedback: Unable to process template language expressions for action 'Condition_2' at line '1' and column '2448': 'The template language expression 'equals(length(body('Get-items')['Specification']), 0)' cannot be evaluated because property 'Specification' cannot be selected. Please see https://aka.ms/logicexpressions for usage details.'.

 

So currently I'm looking at the JSON expressions, which at least make a bit more sense (to me), since I'm more used text based programming, though it would have been nice if there was a template available for my need. Smiley Happy

 

 

 

Community Support Team
Community Support Team

Re: Copy an item from one list to another within a SharePoint site based on condition or updated sta

Hi @paf169,

 

Could you please share a screenshot of the configuration of your flow?

 

The error message told that the expression 'equals(length(body('Get-items')['Specification']), 0)' cannot be evaluated because property 'Specification' cannot be selected.

 

If you would get the Specification value of an item in the list, you should add an "Apply to each" under the "Get-items" action,

The expression of Specification value of each item in the list should be :

items('Apply_to_each')?['department']

 

 

Best regards,

Alice

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (6,143)