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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Filter out MS Teams Sh...
Power Automate
Unanswered

Filter out MS Teams Shift Request Reason from Array

(0) ShareShare
ReportReport
Posted on by 10

Hello all,

 

I am attempting to filter out the list of Time Off Reasons for MS Shifts Time Off Requests and only include, in an email, the reason string of the Reason selected in the Time Off request.

Connectors and Definitions page: https://docs.microsoft.com/en-us/connectors/shifts/#definitions

 

Currently the flow is setup to send an email which is triggered with any request that is created, updated, or deleted. I am in need of finding a way to filter out the reason display text based on the reason ID from the Reasons Array. Thank you 🙂

 

Screenshots or source code can be provided. 

Categories:
I have the same question (0)
  • fchopo Profile Picture
    8,003 Moderator on at

    Hello @AcroPhat_Tech 

    Have a look at this post I wrote some time ago: Re: Time off Time off reason id to the reason Labe... - Power Platform Community (microsoft.com)

    Hope it helps!

    Ferran

  • AcroPhat_Tech Profile Picture
    10 on at

    Hello @fchopo ,

     

    Can you provide clarification to this step please? I'm having trouble understanding what to place into the filer array fields. I'm unable to find the 'sharedTimeOff" dynamic expression.

     

    AcroPhat_Tech_0-1608825580779.png

     

    EDIT****** I got the array filtering setup now! Now I'm having trouble with placing just the display name from the filter array body and placing it into another variable. 

  • fchopo Profile Picture
    8,003 Moderator on at

    Hello @AcroPhat_Tech 

    After the filter array, you could select the first element, and the choose the correct field. Maybe you could execute your flow and have a look at the output of the filter array to look up for the value you want. In any case, you could use "set variable" or "compose" action and enter a similar expression:

    first(body('filter_array'))['shareTimeOff']?['timeOffReasonId']

    Hope it helps!

    Ferran

  • AcroPhat_Tech Profile Picture
    10 on at

    Thank you for the response @fchopo  Should it really be looping through 100? We have less than 15 reasons for time off.

     

    AcroPhat_Tech_0-1608830180735.png

     

  • fchopo Profile Picture
    8,003 Moderator on at

    Hello @AcroPhat_Tech 

    You could store the 15 reasons in an array variable at the beginning of the flow, and in each "apply to each" request item you should only do a search within this 15 elements.

    Hope it helps!

    Ferran

  • AcroPhat_Tech Profile Picture
    10 on at

    Hello @fchopo ,

     

    I was able to filter out the reason using a filter array & select function. I put the 'Reason' displayName into a select table and placed the output of the select into a variable which displays in my email. However, it shows the following. Do you know how I could remove the fluff and just have it show up as Reason: PTO?

    AcroPhat_Tech_0-1609180396289.png

     

  • Verified answer
    fchopo Profile Picture
    8,003 Moderator on at

    Hello @AcroPhat_Tech 

    You could add a Parse JSON action:

    parseJson3.png

     

    Generating the schema from the sample you shared and using the expression:

    first(body('parse_json'))?['reason']

    Hope it helps!

    Ferran

  • AcroPhat_Tech Profile Picture
    10 on at

    Thank you @fchopo for your assistance on my inquiry! I truly appreciate it!

  • Community Power Platform Member Profile Picture
    on at

    Hey @fchopo ,

     

    I've been trying to use your post to solve a similar issue. I am having the same problem where I cannot find "sharedtimeoff" When trying to filter. Any assistance would be greatly appreciated!

     

    -Alex

  • fchopo Profile Picture
    8,003 Moderator on at

    Hi @Anonymous 

    Could start a new thread in the forum with your question, as this one is marked as "solved"? Moreover, that will help other users as well.

    Regards,

    Ferran

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard