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 / Sort Sharepoint List f...
Power Automate
Answered

Sort Sharepoint List from variable

(0) ShareShare
ReportReport
Posted on by 159

Hello I have a 2 sharepoint lists

The first with 3 columns: Name, Email address and department. Values of department are: S, L, V and X .

The second is a list with severals colomns only the department is my interest with same choices than in the other so: S, L, V and X. What I'm looking for is to sort the first list by the department value, took from the new created elemnt, to send email only at the person(s) with the same department value... Can you help me please?

Cyril06_0-1660833393833.png

 

Categories:
  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    @Cyril06  so are you looking at the records in list1 where the departments are not there in list2? and send notifications for those records from list1?

  • Cyril06 Profile Picture
    159 on at

    Hello, no.

    When we add a new record une the second list I want to take the department from it, compare to the records on the first list and send email to the records wich have the same department.

     

    SOrry if I explain badly my english is quite bad !!!

     

    By the way thank you for your interest.

  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    @Cyril06  first, add get items action to get items from second list. Approx how many items would you have in your second list, based on which i can suggest how to get items from the first list.

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Cyril06,

    Do you want to send email to the records that shares the same department with the new created department from the second list?

     

    You should initialize a variable to save the email addresses from multi records that share the same department with the new created department from the second list.

    vqiaqimsft_0-1661152873487.png

    vqiaqimsft_1-1661153019732.png

    Note that 'Business Unit' and 'BU Allowed' are the department column in my scenario, please replace it with yours.

    vqiaqimsft_2-1661153232353.png

     

     

  • Cyril06 Profile Picture
    159 on at

    Hello thank you both for your replies.

    @v-qiaqi-msft I tried your solution i'd like to modify it

    Initialize an arry variable ton complete it and after the Apply to each joining the array with ; ton send only one email to the peole filtered

    Cyril06_0-1661266033087.png

     

    When I do that I have all the email and not only the filtered

    Cyril06_1-1661267196298.png

     

    Do you have a clue ?

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Cyril06,

    Could you please check my reply one more time?

    You should loop though the body from the filter array instead of the value from get items.

  • Cyril06 Profile Picture
    159 on at

    OMG so sorry the detail slipped away !!!!!

    Thanks a lot 

  • Cyril06 Profile Picture
    159 on at

    Sorry but I m in trouble I do not know why into certain list I can find the "Value" and from an other not?...

    I explain with your example upper:

    Cyril06_0-1661346875663.png

    Here you have the "BU Allowed Value"

    In my case the column "BU Allowed" is a choices column named Department.

    I tried to do exactly the same as you but I can't find the "Department Value" only the "Department".

    Do you know what is the difference between the two columns? 

  • Cyril06 Profile Picture
    159 on at

    Ok I finally found why:

    the list where I can't find the departmentvalue is a list created from an other (duplicated in creation).

    I just creat a new one with the exact same columns and I have the departmentvalue !!!!!!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 308 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 159

Last 30 days Overall leaderboard