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

SharePoint WF to Power Automate

I need to convert this 2010 SharePoint Workflow to Power Automate. It was done using hundreds of IF THEN statements which is very inefficient so how can this be done in Power Automate? I heard using a "Select" action but no idea how to use it. Thanks in advance for any assistance.

 

select.jpg

 

 

 

3 REPLIES 3
v-yiwenxie-msft
Microsoft
Microsoft

Hi @NBMS_2019 

 

It seems that the 'current item' in your screenshot is every item in a sharepoint list.

I assume that the 'Site Conversion', 'Site', 'Pubcode' and 'Pubname' are the columns names in your sharepoint list.

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

 

The IF THEN statements can achieved by ‘condition’ or ‘switch’. While you have many statements for a same column, so ‘switch’ fits better here.

 

The ‘select’ action does not fit well here because if you want to use it, you should use two actions--‘select’ and ‘filter array’ to match one IF THEN statement. It’s too troublesome here.

 

I’ve created a list ’test3’ with the same columns and values in it:

2.5-5.PNG

 

After the run of Power Automate Flow, the result in sharepoint list is:

2.5-6.PNG

 

And the whole Power Automate flow looks like this:

2.5-7.PNG

 

The reason why I use condition is that if the value in column is empty, then the ‘switch’ action will get errors. So the condition is used to ensure the value is not empty before going on to ‘switch’ action. If your column value is not empty, then you can just ignore the condition and only use ‘switch’ action as below:

2.5-8.PNG

 

The functions used above are:

empty(items('Apply_to_each')?['Site'])

empty(items('Apply_to_each')?['SiteConversion'])

 

The ‘Site’ and ‘SiteConversion’ may be different in your case, they should be the field name in URL of the column:

2.5-9.png

 

 

The detailed steps for ‘Switch 3’ are:

2.5-10.PNG

 

The functions used above:

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

 

The same structure of ‘switch 3’ applies to ‘switch’ action:

2.5-11.PNG

The functions used above:

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

 

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.

I looked at the switch and it can handle up to "22" cases only which is quite limited since I have 100 plus. By the way, users will update one item at time.

v-yiwenxie-msft
Microsoft
Microsoft

Hi @NBMS_2019 

 

You can then try ‘filter array’ and ‘send an http request to sharepoint’ to update column.

But this is also troublesome too.

Or you can add many switches.

 

Here is the whole flow (I’ve used two examples):

2.11-12.PNG

 

Here are the steps for variables:

2.11-13.PNG

 

The ‘Value’ here is:

[

  {

    "Site Conversion": "Alexandria",

    "Pubcode": "TT",

    "Pubname": "THE TOWN"

  },

  {

    "Site": "Stuart",

    "Pubcode": "SN",

    "Pubname": "TREASURE"

  }

]

 

Here are detailed steps for ‘filter array’ and ‘Apply to each’:

2.11-14.PNG2.11-15.png

 

For more info about send an http request to update Sharepoint column, please go to the link:

Working with lists and list items with REST | Microsoft Docs

 

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.

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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 Solution Authors
Users online (1,317)