Kansas City PowerApps and Flow User Group

Please login or click SIGN UP FOR FREE to create your PowerPlatformUG account to join this user group.
Expand all | Collapse all

Creating a Unique or dynamic 'Recurrence' inside a flow

  • 1.  Creating a Unique or dynamic 'Recurrence' inside a flow

    Bronze Contributor
    Posted Jan 25, 2019 03:35 PM
    Having another problem, not sure there's an answer, however I thought I would ask the community.

    Problem: SafetyCulture's API can only pull 1,000 records per request. The customer I'm trying to support is trying to pull two years worth of data where they do 1,000 records every 4 days. However, the get past time is uses the last time the flow ran, rather than a specific date. I'm trying to set the flow to start on a specific date, grab data for that day plus 4 days. Then when the flow runs again, it starts at the date it left off at, then adds 4 days.

    I would imagine there's an expression I can place into 'Modified after' or 'Modified Before', to help create this type of pull request.

    Does anyone have any recommendations or thoughts on how we can do this?



    ------------------------------
    Joshua Yeamans
    Product Specialist
    Kansas City MO
    9135751209
    ------------------------------


  • 2.  RE: Creating a Unique or dynamic 'Recurrence' inside a flow

    Posted Jan 28, 2019 11:51 AM
      |   view attached
    Hello Joshua!

    Not sure if I understand entirely, but here goes nothing:
    -You want to specify a date range (4 days)
    -Start 2 years back and go until current
    -Pull 1000 correlating records for each 4 day set
    -? And based off the flow attached, you need to do this every 1 hour (not sure)


    First off, without being familiar with the connector you are using... it appears to include a parameter for specifying date ranges:

    DateParam
    You can specify the value of variables for "Modified After" & "Modified Before", either manually or dynamically. For example it could read from an excel document, initialize and run via PowerApp, manually insert / trigger the flow, etc.

    I was unable to get an API key trial for you connector. I will be using HTTP instead, with renamed headers to reflect the Modified Before/After parameters from your connector. The variables are the key takeaway.

    Here's an example of a PowerApp integration - Flow:

    flow
    PowerApp - where the value of variables are declared and Flow is triggered:

    PA

    There are many alternate solutions, but this should help to better understand the logic. If you have any more questions or get stuck feel free to reach out. Good luck on creating your solution!!

    ------------------------------
    Griffin Gaeth
    Application Developer
    Blue Cross Blue Shield of Kansas City

    ------------------------------



  • 3.  RE: Creating a Unique or dynamic 'Recurrence' inside a flow

    Bronze Contributor
    Posted Jan 31, 2019 08:52 AM
    Hi @Griffin Gaeth,

    Thank you for your response. I can definitely see ​how this would work, however how do I add 4 days since the last time the Flow ran without doing it manually??

    I've personally never used PowerApps to trigger or update a flow.

    ------------------------------
    Joshua Yeamans
    Product Specialist
    Kansas City MO
    9135751209
    ------------------------------



  • 4.  RE: Creating a Unique or dynamic 'Recurrence' inside a flow

    Posted Jan 31, 2019 11:07 AM
    @Joshua Yeamans ​ if you just need to run it every 4 days, set the recurrence trigger accordingly.

    4flow
    Is that what you need?

    ------------------------------
    Griffin Gaeth
    Application Developer
    Blue Cross Blue Shield of Kansas City
    Kansas City MO
    ------------------------------



  • 5.  RE: Creating a Unique or dynamic 'Recurrence' inside a flow

    Bronze Contributor
    Posted Jan 31, 2019 11:16 AM
    @Griffin Gaeth Unfortunately, no it's not an every 4 day run this flow.

    I want the flow to run continuously until it's captured all the data from January 1, 2017​ today.

    Known limitations: SafetyCulture's API only allows the flow to pull up to 1,000 inspections per request. The customer's acct I'm working with, does ~1,000 inspection every 4 days and the I'm trying to run the flow continuously until it's captured all inspections from January 1 to today.

    Trying to figure out if there's a way to pull inspections within a given window, then the next time the flow runs, it takes the last date/time of the previous window then adds an additional 4 days until we reach present day. Then I would switch the flow to run the window `Get past time` since the last time the flow ran.

    Does this make more sense?

    ------------------------------
    Joshua Yeamans
    Product Specialist
    Kansas City MO
    9135751209
    ------------------------------