Resonate IT
  • Home
  • Services
    • Expertise
    • Development
    • Support
  • Contact
    • In Progress
  • Blog

Blog

Microsoft Flow - Only run when Document is Published

17/9/2018

1 Comment

 
Sometimes you only want a Flow to run when a document is published, particularly when it comes to document approvals. Currently, Microsoft Flow doesn't yet have an 'on publish' trigger so we need the Flow to run whenever the document is modified, and only continue if the document has just been published. Here's how:
  1. Start with a 'When a file is created or modified (properties only)'  SharePoint trigger
  2. Add a 'Send an HTTP request to SharePoint' action with the following values:
    1. Site Address: your site address
    2. Method: GET
    3. Uri: _api/web/lists/getbytitle('YOURLIBRARYNAME')/items(DOCUMENTID)/FieldValuesAsText
    4. Headers: 
      1. Accept: application/json;odata=verbose
      2. Content-Type: application/json;odata=verbose
  3. Now we need to parse the response into a format that Flow can recognize. Add a 'Parse JSON' action with the following values:
    1. Content: The 'Body' from the HTTP Request response
    2. Schema: Use the schema provided at the end of this post
  4. Finally, you can access the 'OData__x005f_ModerationStatus' value from the 'Parse JSON' output to determine the document's published status. "Pending" means that the document has just been published.
Schema

    
1 Comment

Microsoft Flow - Get Members of a Security Group

23/8/2018

1 Comment

 
I recently designed a complicated Approval workflow for a client and decided to stress-test Microsoft Flow to see how well it worked for this scenario. The outcome; approval workflows can get messy fast! Oh, and Microsoft Flow is a pretty neat tool :D

Even though Flow functionality is improving regularly, some functions required HTTP requests to SharePoint APIs, including how to get members of a Security Group. Here's how its done:
  1. Add a 'Send an HTTP request to SharePoint' action with the following values:
    1. Site Address: Your site address
    2. Method: GET
    3. Uri: /_api/web/sitegroups/getbyname('YOURGROUPNAME')/users?$select=Email
  2. Next, we need to parse the response into a format that Flow can interpret. Add a 'Data Operations - Parse JSON' action with the following values:
    1. Content: The 'Body' from your previous HTTP request action
    2. Schema: If you're like us and are only interested in the Email addresses of the group members, you can use the schema at the end of this post
  3. Now you can use an 'Apply to each' action to do something with each member's Email Address. 

​Enjoy!
Schema

    
1 Comment

    Archives

    September 2018
    August 2018
    February 2017
    November 2016
    October 2016
    September 2016
    August 2016
    July 2016

    Categories

    All
    Business
    Content Management
    Microsoft Flow
    Office 365
    SharePoint
    SharePoint Online

    RSS Feed

Powered by Create your own unique website with customizable templates.
  • Home
  • Services
    • Expertise
    • Development
    • Support
  • Contact
    • In Progress
  • Blog