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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / one flow to update a c...
Power Automate
Unanswered

one flow to update a column with multiple conditions from sharepoint choice column

(1) ShareShare
ReportReport
Posted on by 4
I have a SharePoint List where I would like to update a column (Team Group) based on a Task that is selected by the user.
 
I have 126 unique Tasks and 25 Team Groups that correspond to a variety of Tasks. 
 
I would like to run the flow manually to search each list items, find the Task and update a column with one of the 25 Team Groups based on the Task selected.
 
I started using calculated columns but there is a 38 item limitation of IF statements. 
 
I cannot find any information on how to accomplish this request.
Categories:
I have the same question (0)
  • Kannan_n Profile Picture
    511 Super User 2024 Season 1 on at

    Here’s how you can set up a Power Automate flow to update a column based on multiple conditions from a SharePoint choice column:

    Step-by-Step Guide

    Step 1: Create a Lookup Table

    First, it would be easier to manage the mapping of Tasks to Team Groups if you create a separate SharePoint list (e.g., Task-TeamGroupMapping) to store the task-to-team group relationships.

    Task-TeamGroupMapping List Structure:

    • TaskName (Choice or Single Line of Text)

    • TeamGroup (Single Line of Text)

    Populate this list with all 126 tasks and their corresponding 25 team groups.

    Step 2: Create a Power Automate Flow

    1. Manually Trigger the Flow:

      • Create a new flow in Power Automate.

      • Select "Manually trigger a flow" as the trigger.

    2. Get Items from the SharePoint List:

      • Add an action: "Get items".

      • Configure it to point to your main SharePoint list where tasks are selected by users.

    3. Get Task-Team Group Mappings:

      • Add another action: "Get items".

      • Configure it to point to your Task-TeamGroupMapping list.

    4. Loop Through Each Item:

      • Add an "Apply to each" action.

      • Select the value from the main SharePoint list as the output for the "Apply to each" action.

    5. Find Corresponding Team Group:

      • Inside the "Apply to each" action, add a "Filter array" action.

      • Use the output from the Task-TeamGroupMapping list.

      • Set the condition to match the TaskName from the main SharePoint list to the TaskName from the Task-TeamGroupMapping list.

        json
        @equals(items('Apply_to_each')['TaskName'], item()['TaskName'])
        
    6. Update the Item in the Main List:

      • Add a "Condition" action to check if the filtered array is not empty.

      • If the condition is true (array is not empty):

        • Add an "Update item" action.

        • Set the item ID to the ID of the current item in the main list.

        • Set the TeamGroup field to the value from the filtered array.

    Example Setup in Power Automate:

    Initialize Variables and Get Items:

    1. Initialize an array variable to store Task-TeamGroup mappings.

      • Type: Array

      • Name: TaskTeamGroupArray

      • Value: []

    2. Get items from the Task-TeamGroupMapping list and append them to TaskTeamGroupArray.

    Apply to Each Item in the Main List:

    1. In the "Apply to each" action, use a "Filter array" to find the corresponding TeamGroup.

    2. Use a "Compose" action to extract the TeamGroup from the filtered array.

    3. Use the "Update item" action to update the TeamGroup field in the main list.

    Implementation Notes:

    • Error Handling: Add error handling to ensure the flow can gracefully handle any issues, such as missing tasks or team groups.

    • Optimization: To improve performance, consider batching updates if you have a large number of items.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 664

#2
Haque Profile Picture

Haque 460

#3
Valantis Profile Picture

Valantis 357

Last 30 days Overall leaderboard