Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

I want to filter out the columns names which have Yes(Tick Mark) in my Sharepoint List

(0) ShareShare
ReportReport
Posted on by 20

Hi,
I have a Sharepoint list consisting of these columns of Yes/No data type.

Acceptable Usage Policy
Assets Management Policy
Email & Information Exchange Policy
Information Security Policy
Endpoint Security Policies & Procedures
Information Security Incident Management
Teleworking Policy
Non-Conformity and Corrective Action Policy
Backup Policy
Human Resources Security Policy
Mobile Device Policy

 

Vaheeth_Raj_0-1699437426618.png


Now, I want to filter out the column names which have "Yes"(Tick Mark) in it and send it in an Email.
Plz help me with this.
Need a resolution ASAP

  • Verified answer
    Chriddle Profile Picture
    7,669 Super User 2025 Season 1 on at
    Re: I want to filter out the columns names which have Yes(Tick Mark) in my Sharepoint List

    Short, quick and easy to maintain, but property names are encoded at the end:

    Chriddle_3-1700480330939.png

     

    Select

    From:

    xpath(
    	xml(json(concat('{"Root":{"Item":', outputs('Compose'),'}}'))),
    	'/Root/Item/*'
    )

    Map:

    xpath(item(), 'name(/*)')

     

    Select 2

    From:

    union(body('Select'), json('[]'))

    Map Label:

    item()

    Map Trueish:

    greater(
    	xpath(
    		xml(json(concat('{"Root":{"Item":', outputs('Compose'),'}}'))),
    		concat('count(/Root/Item[', item(),'="true"])')
    	),
    	0
    )

     

    Output:

    [
     {
     "Label": "Name",
     "Trueish": false
     },
     {
     "Label": "Acceptable_x0020_Usage_x0020_Policy",
     "Trueish": true
     },
     {
     "Label": "Assets_x0020_Management_x0020_Policy",
     "Trueish": false
     },
     {
     "Label": "Email_x0020__x0026__x0020_Information_x0020_Exchange_x0020_Policy",
     "Trueish": true
     }
    ]

      

    Notice: "Label" is encoded for XML node names (basically ASCII hex).

    After filtering this output, you get the wanted list.

  • v-jefferni Profile Picture
    on at
    Re: I want to filter out the columns names which have Yes(Tick Mark) in my Sharepoint List

    Hi @Vaheeth_Raj ,

     

    Sorry for the late. I finally think of a way to get through it! Please follow below steps:

     

    vjefferni_1-1700211766112.png

    vjefferni_2-1700211794479.png

    vjefferni_3-1700211942815.png

     

    1. Create an array in Compose to include all the column names (you must find the internal column names in list settings, select the column, copy the name from url):

    vjefferni_0-1700211178634.png

    [
    "AcceptableUsagePolicy",
    "AssetsManagementPolicy",
    "EmailInformationExchangePolicy",
    "InformationSecurityPolicy",
    "EndpointSecurityPoliciesProcedures",
    "InformationSecurityIncidentManagement",
    "TeleworkingPolicy"
    "Non-ConformityandCorrectiveActionPolicy",
    "BackupPolicy",
    "HumanResourcesSecurityPolicy",
    "MobileDevicePolicy"
    ]

     

    2. Initialize an empty array variable.

     

    3. In Apply to each control, looping through this array, Get items using Filter query:

    items('Apply_to_each') eq 1

     

    4. Checking if at least 1 item is there in the list in Condition control

     

    5. If true, it means this column has at least one tick, so append to array variable using this column name and YES

    items('Apply_to_each'): YES

     

    6. Use the array variable to create an HTML table, use this table in body of Send Email action.

     

    Best regards,

  • Vaheeth_Raj Profile Picture
    20 on at
    Re: I want to filter out the columns names which have Yes(Tick Mark) in my Sharepoint List

    Hi,

    Yes you are right

     

  • v-jefferni Profile Picture
    on at
    Re: I want to filter out the columns names which have Yes(Tick Mark) in my Sharepoint List

    Hi @Vaheeth_Raj ,

     

    Let's take the screenshot as example. There are 5 rows with 5 columns, and only 2 columns include ticks, so the output you want are:

    Acceptable Usage Policy Yes
    Assets Management Policy Yes

     

    Am I right?

     

    Best regards,

  • Vaheeth_Raj Profile Picture
    20 on at
    Re: I want to filter out the columns names which have Yes(Tick Mark) in my Sharepoint List

    Hi, 

    My main Requirement is to display only the column names which are marked as "Yes"(TickMark).
    Let's say there are 10 columns and out of those only 5 columns are marked as "Yes"(TickMark). 
    I need these 5 column names as an output. Simple. I hope this is clear.
    I shall take care of the mail body.

  • v-jefferni Profile Picture
    on at
    Re: I want to filter out the columns names which have Yes(Tick Mark) in my Sharepoint List

    Hi @Vaheeth_Raj ,

     

    I really don't understand what you want to output from Compose and put in mail body. Could you make a more specific example in a screenshot, using the table your provided originally?

    vjefferni_1-1699516519356.png

     

    Best regards,

  • Vaheeth_Raj Profile Picture
    20 on at
    Re: I want to filter out the columns names which have Yes(Tick Mark) in my Sharepoint List

    Hi,

    The mail body template is the output of the compose action.
    I usually use select data operation -> Create HTML Table -> Compose -> send an Email(V2), 
    I want to display two columns in output, 
    1. Policy Name which is the column name in the sharepoint list
    2. Acknowledgment - Yes / No

    I want to filter out the column names which are showing Yes(Tick Mark) only.

  • v-jefferni Profile Picture
    on at
    Re: I want to filter out the columns names which have Yes(Tick Mark) in my Sharepoint List

    Hi @Vaheeth_Raj ,

     

    I need know the mail body template, could you provide it to me?

     

    Best regards,

  • Vaheeth_Raj Profile Picture
    20 on at
    Re: I want to filter out the columns names which have Yes(Tick Mark) in my Sharepoint List

    Hi,

    Can i use a loop condition to check each of the column , if true then it appends to a variable.
    The output of the variable can be the content of my mail body.
    I want a solution like this. I have the idea but not able to execute.
    If u know to implement this idea please help me with the screenshot of the steps.

  • v-jefferni Profile Picture
    on at
    Re: I want to filter out the columns names which have Yes(Tick Mark) in my Sharepoint List

    Hi @Vaheeth_Raj ,

     

    You will need expressions for each column, hardcoding column names. For example:

    if(equals(items('Apply_to_each')?['Acceptable Usage Policy'], true), 'Acceptable Usage Policy', '')

     

    Best regards,

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,658 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow