Steps With Watch Priority
SCRIPTING
Ask
What start date to use?
Default Answer
Yesterday 00:00

Provided Input
SCRIPTING
Ask
What end date to use?
Default Answer
Yesterday 23:59

Provided Input
CALENDAR
Add
1
days
from
End

Adjusted Date
HEALTH
Find
Library
where
All the following are true [{'class': 'filter-property', 'value': 'Type'}, {'class': 'filter-operator', 'value': 'is'}, {'class': 'filter-benchmark', 'value': 'Steps'}] [{'class': 'filter-property', 'value': 'Start Date'}, {'class': 'filter-operator', 'value': 'is between'}, {'class': 'filter-benchmark', 'value': 'Start', 'glyph': '', 'UUID': 'F0FEFA29-2493-4DE6-AE83-7254F1BA99EB'}, {'value': 'and'}, {'class': 'filter-benchmark', 'value': 'Adjusted Date', 'glyph': '', 'UUID': '95423E91-C117-4EA2-A97E-0DA39E1FB71E'}]

Health Samples
SCRIPTING
Repeat with each item in
Health Samples

Repeat Results
NOTHING
Nothing
SCRIPTING
If
Start
is less than
Repeat Item
SCRIPTING
If
End
is greater than
Repeat Item
TEXT
Repeat Item

Text
SCRIPTING
If
Text
contains
Watch
VARIABLES
Add
Repeat Item
to
Watch
SCRIPTING
End If

If Result
SCRIPTING
If
Text
contains
Phone
VARIABLES
Add
Repeat Item
to
Phone
SCRIPTING
End If

If Result
SCRIPTING
End If

If Result
SCRIPTING
End If

If Result
SCRIPTING
End Repeat

Repeat Results
SCRIPTING
Count
Items
in
Watch

Count
SCRIPTING
Count
Items
in
Phone

Count
SCRIPTING
Show alert
Informational Message
SCRIPTING
Repeat with each item in
Watch

Repeat Results
CALENDAR
Subtract
1
minute
from
Repeat Item

Adjusted Date
CALENDAR
Add
1
minute
from
Repeat Item

Adjusted Date
SCRIPTING
Repeat with each item in
Phone

Repeat Results
TEXT
Phone sample:
Repeat Item 2
-
Adjusted Watch end
Watch timeframe:
Adjusted Watch start
-
Repeat Item 2

Text
DATE
Specified Date
Repeat Item 2

Date
DATE
Specified Date
Adjusted Watch start

Date
DATE
Specified Date
Adjusted Watch end

Date
SCRIPTING
If
Phone sample start
is between
Watch start threshold
and
Watch end threshold
COMMENT
Phone is Between watch threshold. Removing from list.
NOTHING
Nothing
SCRIPTING
Otherwise
VARIABLES
Get
Repeat Item 2
SCRIPTING
End If

If Result
SCRIPTING
End Repeat

Repeat Results
VARIABLES
Set variable
Phone
to
Repeat Results
SCRIPTING
End Repeat

Repeat Results
SCRIPTING
Count
Items
in
Phone

Count
TEXT
Phone samples before filtering:
Count
Phone samples after filtering:
Count

Text
SCRIPTING
Show alert
Informational Message
VARIABLES
Add
Watch
to
Samples
VARIABLES
Add
Phone
to
Samples
HEALTH
Find
Samples
where
All the following are true [{'class': 'filter-property', 'value': 'Type'}, {'class': 'filter-operator', 'value': 'is'}, {'class': 'filter-benchmark', 'value': 'Steps'}] [{'class': 'filter-property', 'value': 'Start Date'}, {'class': 'filter-operator', 'value': 'is between'}, {'class': 'filter-benchmark', 'value': 'Start', 'glyph': '', 'UUID': 'F0FEFA29-2493-4DE6-AE83-7254F1BA99EB'}, {'value': 'and'}, {'class': 'filter-benchmark', 'value': 'Adjusted Date', 'glyph': '', 'UUID': '95423E91-C117-4EA2-A97E-0DA39E1FB71E'}]

Health Samples
VARIABLES
Set variable
Samples
to
Health Samples
SCRIPTING
Get
First Item
from
Samples

Item from List
SCRIPTING
Get
Last Item
from
Samples

Item from List
MATHS
Calculate the
Sum
of
Samples

Statistics
MATHS
Calculate the
Average
of
Samples

Statistics
MATHS
Round
Average
to
Ones Place

Rounded Number
TEXT
Selected Time Range:
End
-
End of Steps Data
Total Steps:
Sum
Average Steps/min:
Start
Start of Steps:
Rounded Number
End of Steps:
Start of Steps Data

Text
SCRIPTING
Show
Text
Showcuts