►
From YouTube: Community Demo - SharePoint $batch usage in Microsoft Flow automation to improve performance
Description
This community call demo is taken from the SharePoint General SIG community call recording on 5th of September 2019. In this video, John Liu (FlowStudio) demonstrates how to improve performance of Microsoft Flow using $batch operation when operating with SharePoint list items.
Presenter - John Liu (FlowStudio) @johnnliu
Full details on the community call from https://developer.microsoft.com/en-us/sharepoint/blogs/sharepoint-dev-community-pnp-general-sp-dev-sig-recording-5th-of-september-2019/
More details on getting started on using Microsoft Flow - https://docs.microsoft.com/en-us/flow/getting-started
More details on the SharePoint dev community calls from http://aka.ms/sppnp.
A
Okay,
so
I
wanted
to
do.
A
quick
demo
of
using
a
batch
batch
is
available
on
the
SharePoint
rest
endpoint
for
a
long
time,
I'm
based,
oh
yeah
and
and
before
I,
really
go
in
and
I
know,
I,
don't
know
what
that
is.
Andrew
is
still
here
but
anyway
I'm
to
read
about
batch.
It's
documented
here
a
long
time
ago,
but
the
documentation
is
never
as
clear
as
the
official
documentation,
which
is
our
andrew
corners
blog,
which
is
here
three
Andrew
corners,
blog
post.
A
That's
why
you
should
go,
and
then
I
read
these
two
when
Andrew
goes
quite
a
lot
deeper
into
how
how
to
do
batch,
but
basically,
instead
of
just
sending
a
simple
you
know
we're
probably
familiar
with
this
kind
of
this
kind
of
HTTP
requests.
Instead
of
doing
just
that,
you
can
put
multiple
of
them
together,
put
some
text
in
the
middle.
A
It
just
had
to
be
like
this
and
then
create
a
gooood
to
kind
of
mark
the
boundaries
of
the
batch
and
then
send
us
whole
thing
has
one
go
so
that's
how
batch
works
now
I
went
back
and
check
Andrews
blog
post.
This
was
this.
Is
timeless
he
did
in
2015
that's
how
nice
anyway
and
I'm,
taking
it
out
and
doing
guys.
Let's
do
bad
chicken,
that's
what
I'm
up
to
so
and
if
you're
using
p.m.
PJs,
which
I've
been
using
for
a
long
time
p.m.
A
PJs
test
rapido
inside
the
the
fluence
and
woody,
could
the
flu
and
syntax.
So
you
could
just
say:
do
lots
of
stuff
do
it
in
this
patch
and
then
execute
the
whole
batch.
So
that's
how
I've
been
doing
it,
but
that's
the
raw
HTML
that
we
need
to
do
and
then,
if
you
think,
PM
PJs,
that's
the
rapid
I
already
does
it.
So
you
don't
have
to
worry
about
it,
and
so
you
might
be
saying
John.
Why
are
you
doing
in
floating?
Well,
that's!
That's!
A
Actually,
let
me
start
here
so
I
have
two
lists.
This
is
the
source
list.
It's
got
about
11
items,
okay,
when
I'm
presenting
to
like
a
blank
room,
just
kind
of
quickly
check.
Okay,
people
are
still
there
good.
My
biggest
fear
is
you
know
if
I
suddenly
disconnect
and
I
just
keep
talking,
and
nobody
knows
anyway.
A
A
Yeah,
well
it's
doing
that,
okay,
so
the
whole
idea
is
that
I
have
a
a
sauceless
of
you
know,
a
number
of
items
and
I
might
have
a
destination.
I
just
want
to
copy
order.
This
across
okay
and
now
I
want
to
do
any
flow
now
traditionally
in
flow.
What
we
would
do,
then,
is
we
will
fetch
all
the
items
then
we'll
put
it
into
some
sort
of
for
each
loop
and
then
for
each
one.
We
are
determined.
Oh
that's.
A
This
item
exists
in
the
source
right,
so
let
me
let
me
make
I
mean,
probably
so
we're
basically
say
K
items,
then
what
do
for
each
then
we'll
say
get
item,
that's
exists
and
then
either
insert
or
update
right.
So
that's
the
traditional.
You
know
if
you're
building
a
flow
from
scratch.
We
do
like
this.
Now.
This
works.
Okay.
If
you
only
have
a
few
items
as
soon
as
soon
as
you
have
many
items,
this
becomes
very
slow
because
you
might
pay.
You
know
one
cost
for
this,
then
you
pay
and
cost.
A
With
this
the
number
of
rows
and
then
does
exists.
Then
you
pay
another
income
for
this.
So
very
quickly,
are
you
writing.
Maybe
ship
on
throttling
also
in
flow
each
connection.
You're,
basically
like
fetching
the
connection
or
fetching
do
doing
the
authentication
make
your
call
and
then,
when
you
return
throws
it
all
the
way.
So
the
next
action
you
do
it.
Does
it
again
so
over
time
you
feel,
if
you
say,
looping
through
a
large
list.
This
gets
quite
slow
right.
So
basically
that
was
the
problem.
A
I
was,
you
know,
facing
I'm,
updating,
more
and
more
or
less
items
and
they're
getting
really
slow
and
I
just
wanted
them
to
run
quicker,
so
I
started
looking
into
batch.
That
was
something
I
knew
that
existed
and
I
thought
I
wonder
if
I
can
make
it
work
and
so
to
make
patchwork.
So
this
is
a
this
is
the
flow.
This
is
a
so
the
I
have
to
do.
I
want
to
show
this
one
will
come
back
to
later,
but
I'll
just
explain
what
the
bosses
do.
A
This
one
gets
the
source
items,
so
this
is
the
this.
Is
this
list
and
I
guess
the
destination
and
then
I'm,
basically
juggling
between
them
using
either
filter
or
select
to
to
basically
work
out
what's
new,
so
filter
or
select?
If,
since
you
know,
this
is
the
developer
code,
filter
is
a
rate
of
filter
and
select
is
a
rate
of
map
okay.
So
if
you're
thinking
oh,
what
are
these
fancy
dart
operations
in
flow?
A
That's
what
they
met
so
in
general,
ink
flow
you're
trying
to
use
the
data
operations
to
string
down
your
array
as
quickly
as
you
can
and
then,
within
these
two
I
do
a
bit
of
Union
I
figure
out
what's
new
and
what
needs
to
be
updated
and
then
basically
the
trick
oops
the
trick
to
both
the
insert
and
the
update
is
here:
where
is
it
so
insert
chunk?
Basically,
is
this
right?
It's
very
similar
to
this,
which
is
this
this
this
thing
that
we
are
doing
so.
A
Basically,
that
is
one
we're
doing
that,
and
then
we
can
actually
replace
this
line
with
the
actual
JSON
of
the
of
the
of
the
SharePoint
item
that
we're
sending
to
this,
and
then
some
here
with
the
update
update,
has
a
if
match.
I
just
saw
overwrite
I,
don't
actually
check
e-tec
I,
just
overwrite
and
I
merge
everything
at
the
end
and
send
it
to
SharePoint
in
one
hit.
So
this
joins
all
the
inserts
and
updates
together.
A
I've
got
another
one
in
production
that
also
does
deletes,
so
he
actually
works
out
between
two
source
lists
and
destination.
What's
new
what
needs
to
be
updated
and
what
needs
to
be
deleted
and
then
it
just
does
the
merging
one
hit.
So
that's
how
that
this
kind
of
what
you
call
fast
sync
works.
I
have
another
quick
one
here.
This
one
I've
actually
replaced
this
so
I
get
the
item.
Batteries
throw
the
way
I'm
just
gonna
create
a
random
at
one.
Two.
Fifty
and
the
title
I
do
put
a
random
text.
A
A
So
you
see
getting
items
are
fairly
quick,
Oh
that
other
composer,
almost
zero,
second
converting
or
combining
erase
so
filters
and
select
a
really
quick
compose
is
really
quick
apply
to
each
can
be
slow
and
ultimately,
sending
sending
fifty
updates
to
SharePoint
took
thirteen
seconds
if
I
come
here.
Let
me
see.
A
So
they
hold
all
the
items.
So
this
is
the
Rendon
I
was
talking
about
one
John
or
John
too,
so
there's
been
a
random
in
how
I
name
things
but
they're
all
written,
basically
in
one
bench
up
to
fifty
okay.
So
that's
the
that's
the
random
that
wants
to
set
it
up
so
that
wanted.
What
did
it
do?
You
did
15
seconds,
let's
come
over
here
and
show
you
this
one.
So
this
one
I
have
this
list
so
doesn't,
as
only
has
11
items,
and
there
are
all
in
this
order.
A
A
A
So
let
me
just
copy
that
now
and
pop
that
over
here,
so
basically-
and
it
just
created
this-
not
too
many
just
created
this
now,
there's
a
few
more
things
inflow
that
makes
a
really
easy
flow
has
a
good
method
expression,
so
it
could
create
these
schools
quite
easily.
The
other
thing
that
flow
has
is
a
JSON
method,
which
is
basically
a
JSON.
A
A
Two
two
two
and
there's
a
few
more
thinking,
I
haven't
really
gone
now
impact
you
could
do
additional
things
like
when
I
create
an
item
also
changes
permission,
and
maybe
you
know
to
do
additional
code,
so
it
doesn't
have
to
be
just
item
updates.
You
can
batch
a
bunch
of
things
together
in
one
call
so
to
test
those
ideas,
but
ultimately
this
flow
is
quick
because
we
talk
to
sharepoint
only
three
times
this
one,
this
one
and
this
one
okay,
so
a
code
I
would
have
otherwise
taken.
A
Maybe
50
connections
to
SharePoint
switch
drink
it
down
to
three.
When
we
are
writing
flow
as
developers,
we
should
think
of
flow
as
the
orchestration
engine.
Don't
think
so
much
of
it
as
a
workflow
engine.
You
want
to
run
things
in
parallel
when
they're
not
related.
You
want
to
filter
your
array
quickly.
You
want
to
map
your
JSON
and
then
very
quickly
get
into
your
right.
A
So
thinking
parallel
and
generally,
your
flow
will
be
a
lot
quicker,
so
so
yeah,
those
are
six
second
one
more
one
more
trick:
I,
don't
really
having
a
demo
but
matches
quickly
bill
blink
when
I
use
a
button
trigger
to
start
this
flow,
but
you
can
actually
use
the
automated
trigger
if
I
use
SharePoint.
A
When
item
is
created
or
modified
and
I'll
show
you
this
setting
here
in
the
SharePoint
trigger
should
appear
anytime
soon
there
is
a
setting
in
the
back,
so
setting
genuinely
the
trigger
is
running
with
a
split
on,
and
this
is
something
that's
in
logic
apps
as
well,
but
basically
SharePoint
Riga
is
a
web
hook
plus
a
polling
trigger
in
that
when
he
gets
kind
of
notified
that
things
have
changed.
It
gets
a
small
array
of
multiple
items
now
because
of
the
synchronizing
of
tool
is
run
so
fast.
A
You
actually
don't
need
it
to
run
on
each
item.
You
can
actually
say
you
know
what
don't
worry
about
this.
Just
give
it
to
me
as
either
one
item
or
array:
I,
don't
really
queue,
and
then
I'm
gonna
run
the
sync
just
on
the
whole
list
anyway,
so
that
was
safe.
You
hope
until
flow.
So
if
I'm
saying
creating
a
flow
to
automatically
sync
every
change
here
into
this
list,
then
I
will
run
this
trigger
in
batch
mode.
A
So
I,
don't
really
care
which
item
is
the
one
that's
running
so
yeah
now
I
did
wanted
to
kind
of
end
with
the
thought
that
I
was
really
enjoying
the
the
list
view
the
tile
things
where
we
could
do
the
tile
few
of
these
lists.
Only
if
I
see
here
no
no
here
yeah,
but
in
the
view
you
can
also
create
flow
buttons.
So
you
can
actually
have
your
end.
Users
trigger
flow
on
these
items
and
I
was
really
thinking.
How,
like
you,
know,
JSON.
A
We
do
have
to
know
a
bit
of
JSON,
so
I
consider
a
low
code,
not
no
code,
but
in
the
local
world
we
can
now
customize
SharePoint
lists
to
be
quite
pretty
very
functional,
and
you
have
the
list
view
JSON
in
the
front.
So
almost
like
a
UI
right,
it's
running
the
browser,
but
you
have
flow
able
to
run
in
the
backend
almost
like
a
local
server.
That's
doing
all
these,
you
know
cross
list
copying.
Maybe
you
need
to
copy
to
another
list
at
the
end
user.
A
A
I
want
to
probably
end
with
one
more
so
we
I've
recorded
a
session
on
the
flow
conference
on
how
to
make
the
flow
really
quick,
I'm
right
at
the
end
and
I
go
into
how
these
filter
and
flow
are
always
I'm.
Writing
a
bunch
of
the
flow
MVP's
are
here
where
I
mentioned,
you
know:
how
do
we
bring?
These
flow
runs
down
and
you
know
diving
deeper
into
the
filter
and
it's
linked
and
how
those
work
so
I
just
want
the
end.
With
that
I'll
go
and
sign
up.
A
B
Really
good
stuff,
a
really
good
stuff
and
it's
good
to
see
and
a
crazy
amount
on
the
integration
of
flow
and
sharepoint
and
sharepoint
is
one
of
the
most
used.
Let's
say
friends
so
flow
in
the
flow
world,
because
a
lot
of
people
are
using
sharepoint
and
lists
and
all
of
that,
and
then
that
starts
the
flow
operations
and
all
that.