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 / Retrieve runtime conte...
Power Automate
Unanswered

Retrieve runtime context (user name) for scheduled flow

(0) ShareShare
ReportReport
Posted on by 13
I have a flow that executes each day at 15:00 - It produces a simple report and emails it to three people.
 
Each of the three people has had the flow shared to them and they have the ability to go to flow.microsoft.com, select the flow via 'shared with me' and run the flow.  
 
What I would like to do is detect if my run is a scheduled run in which case I will send the report to all three people or if it is a manually initiated run, just send the report to the person manually running the report.
 
Any thoughts?
 
Stan
Categories:
I have the same question (0)
  • SaiRT14 Profile Picture
    1,990 Super User 2025 Season 2 on at
     
    Add a Condition action to check whether the trigger was the recurrence or a manual one. You can use an expression like this: if(triggerOutputs()?['name'] == 'Recurrence')
     
    pls try and let me know if you need more details. Thanks
  • Stan_W_Gifford Profile Picture
    13 on at
    Unfortuanly been there. There are no reported trigger outputs.
     
    triggerOutputs()?['name'] (compose) returnes null;
     
    triggerOutputs on its own also returns null
     
    workflow() returns
     
    {
      "id""/subscriptions/0ddd3040-a2c6-4877-8e3a-7a8cd3209f44/resourceGroups/779B4B32EA0B4E96B5337FE0624406E2-235EAA1FA3C44174909ACE1D44DC151A-ENV/providers/Microsoft.Logic/workflows/43150d96-5f3b-4a1a-8a18-8482a60bd68e",
      "name""43150d96-5f3b-4a1a-8a18-8482a60bd68e",
      "type""Microsoft.Logic/workflows",
      "location""australiasoutheast",
      "tags": {
        "flowDisplayName""test trigger",
        "environmentName""235eaa1f-a3c4-4174-909a-ce1d44dc151a",
        "logicAppName""43150d96-5f3b-4a1a-8a18-8482a60bd68e",
        "environmentFlowSuspensionReason""235eaa1f:2Da3c4:2D4174:2D909a:2Dce1d44dc151a-None",
        "state""Enabled",
        "createdTime""1/28/2025 2:29:31 AM",
        "lastModifiedTime""1/28/2025 10:25:22 PM",
        "createdBy""404cc680-6223-4178-b761-effcdf5a7bb6",
        "triggerType""Scheduled"
      },
      "run": {
        "id""/subscriptions/0ddd3040-a2c6-4877-8e3a-7a8cd3209f44/resourceGroups/779B4B32EA0B4E96B5337FE0624406E2-235EAA1FA3C44174909ACE1D44DC151A-ENV/providers/Microsoft.Logic/workflows/43150d96-5f3b-4a1a-8a18-8482a60bd68e/runs/08584635037578213274818007694CU18",
        "name""08584635037578213274818007694CU18",
        "type""Microsoft.Logic/workflows/runs"
      }
    }
     
    which does have a value called name - which is a GUID - however a scheduled execution as well as a manually execution both return the same value (GUID) for name...........
  • Verified answer
    Stan_W_Gifford Profile Picture
    13 on at
    FWIW - I have worked out that if the current time is not the scheduled time (assuming only one run a day) I can determine if this is a scheduled run or a user initiated run
     
    Still does not give me the user name :-(

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard