►
From YouTube: Community Demo - indexOf, toLowerCase, join and length operators for the list formatting
Description
This community call demo is taken from the SharePoint General Development Special Interest Group recording on 7th of February 2019. In this video Chris Kent (DMI) shows how to use indexOf, toLowerCase, join and length operators in the list formatting definitions.
Presenter - Chris Kent (DMI) - @thechriskent
More details on the SharePoint dev community calls from http://aka.ms/sppnp.
A
Hello,
everybody
I'm
Chris
Kent,
that's
that
stuff.
Alright,
let's
move
along.
Let's
take
a
look
at
some
of
the
stuff
we
got
today.
So
I've
got
some
really
exciting
stuff
to
share
with
you
guys
so
I
was
doing
some
snooping
around
in
the
column.
Formatting
list
formatting
stuff
the
code
there
because
it
is
JavaScript
and
anybody
can
do
that
and
I
found
some
new
things.
I
want
to
show
you,
because
it's
good
do
some
pretty
cool
stuff.
A
So
over
here
we
got
our
warrior
horses
site
right,
so
those
are
horses
that
are
warriors
I,
hope
that
makes
that
obvious
and
of
course
they
use
SharePoint
to
help
manage
things
and
here
they're
managing
their
agents.
So
they've
got
a
variety
of
agents
around
the
world
right
doing
very
important,
warrior
horses
business
and
they
want
to
spruce
this
list
up
a
little
bit
right.
So
they've
got
a
nice
little
picture
of
the
horse,
but
they
want
to
do
some
more
things
here.
So
they've
got
their
phone
number.
A
You
know
what
they
like
to
drink
and
their
status
currently
right.
So
let's
take
a
look.
What
we
can
do
so
before
we
get
to
that?
Let's
take
a
look
at
some
of
the
new
operations
right,
our
operators
out
here.
So
if
we
format
this
column,
we're
going
to
use
that
we're
just
going
to
type
this
in
ourselves.
So
we're
going
to
say,
element
type,
is
div
right
out
of
comma
and
we're
going
to
say,
text
content
rules,
and
this
is
a
new
one,
so
index
table.
A
This
is
a
super
powerful
thing,
so
I'm
gonna
give
it
the
title
column
alright.
So
if
I'm
looking
at
the
title,
column
and
I'm
looking
for
say
the
letter
R
lowercase
R-
and
let's
just
run
that,
let's
close
this
thing
up,
let's
preview,
that
you'll
notice
here
we
get
the
actual
index
inside
the
title
column,
which
is
code
name
in
this
case,
I've
renamed
that
that's
simple.
So
you
can
see
right
here.
This
one
says
number
four,
because
right
there,
it's
a
zero
based
index,
so
zero
one,
two
three
four
as
they
are.
A
You
said
all
the
way
down
here
and
that's
great
that
we
can
see
that
it's
a
four.
But
what
really
helps
is
we
see
things
like
negative
one
right?
There
is
no
R
here,
so
you
get
a
negative,
any
less
getting
a
ton
of
static.
There's
that
me
no
all
right
there
there's
some
yeah
I'll
double
check.
If
I
can
clean
it
soon.
Okay,
that's
gone
all
right,
so
negative,
one
means
it's
not
found
and
that's
super
helpful.
Even
better
is
when
we
do
like
capital
a
and
we
could
see
zero.
A
So
we
can
see
it
starts
with
so
a
negative
once
then,
is
extremely
helpful,
so
we're
gonna
see
how
we
use
that
in
just
a
minute.
So
that's
index
up.
So
what
you
do
is
you
provide
what
you
want
to
look
inside
of
and
what
you're
searching
for
and
it'll
tell
you,
whether
it's
in
there
or
not?
Okay.
So
now,
let's
take
a
look
at
another
one
here:
let's
do
two
lowercase.
This
one
should
be
pretty
obvious.
So
two
lowercase
all
right,
we'll
get
rid
of
the
second
parameter.
A
It's
just
one
parameter
we're
gonna,
pass
it
in
title
and
to
preview
that
it
just
takes
whatever
that
is.
It
makes
its
lowercased
pretty
pretty
exciting
stuff.
Alright,
let's
take
a
look
at
another
new
one
and
that
is
joined
so
joined.
You
might
not
realize
it,
but
some
of
these
things
are
arranged
behind
the
scenes
right.
So
in
this
case
our
drink
preference
is
a
multi,
select
choice,
column
right,
so
I
can
choose
multiple
things
here.
A
What
if
I
wanted
to
put
those
all
together
right
so
by
default,
if
I
don't
apply
any
formatting,
but
the
multi
choice
I
get
a
comment
of
space.
If
it's
a
person
field
to
actually
go
on
new
lines
right,
if
I
do
any
kind
of
formatting
with
them,
I
lose
the
space
and
a
person
field.
You
get
a
so
Michael.
What?
If
you
want
to
control
that?
Well,
that's
where
you
provide
your
array
right
here
and
then
you're
gonna
put
it
in
wonder
if
your
separator
is
so.
A
If
I
want
to
put
it
ampersand
in
there,
I
will
preview
that
there
we
go.
So
we
get
this
nice
way
to
really
control
what
goes
on
there
all
right!
Oh
that's
a
good
point!
Yeah!
That's
a
good
point!
Let's
see
we
can
do
last.
One
I
want
to
show
you
those
because
I
think
it's
a
little
misleading
is
length,
so
you
would
think
length
would
be
like
a
Nelion
function
right
so
give
us
our
string
li,
but
it's
actually
designed
for
a
raise.
So
it
tells
us
how
many
items
are
in
array
right.
A
So
if
we
preview
that
we
can
see
that
there
were
five
choices
here,
two
choices
here
and
so
on
all
right.
If
we
tried
to
do
that
with
a
string,
Mike
will
come
back
in
title,
you're
always
going
to
get
a
one.
If
that
string
is
present,
if
the
object
is
not
there,
you're
gonna
get
a
zero.
So
it's
a
little
bit
seedy.
A
So
if
you
care
about
the
link
function,
I'm,
not
actually
the
demo
of
the
sample
back,
because
I
really
wanna
find
a
great
use
for
you
all
right
now,
let's
actually
take
a
live,
look.
Can
we
do
with
this
information
right,
so
I
want
to
look
at
that
starts
with
right.
So
the
whole
idea
of
an
index
of
you
know
where
it
becomes
zero.
So
there
is
not
currently
a
way
to
deceased
ringing.
A
Sorry,
hopefully
that
hopefully
becomes
it
wouldn't
be
hard
to
implement
that
so
we'll
see,
let's
put
a
user
voice
in
on
that
one
all
right.
So
this
starts
with
so
we've
got
several
new
samples
for
you,
I
think
ahead
in
five
or
six
the
other
day,
so
here's
one
for
starting
with
alright.
So
this
is
in
our
SP
dev
list
for
money,
repo
under
column
samples
text
starts
with
calling
codes.
Very
catchy
name
simulators.
Remember,
alright.
A
Those
are
gonna
grab
this
so
again
with
the
list
for
many
samples
you
don't
have
to
do
any
kind
of
crazy
get
stuff.
You
just
copy
and
paste
this
stuff,
I'm
gonna
copy
it.
So
what
I'm
looking
at
is
this
phone
number
here.
That's
great
I've
got
the
international
calling
code
because
we
are
citizens
of
the
world
alright.
But
what
if
I
want
to
do?
You
know
I
want
to
actually
understand.
Who
am
I
calling.
Where
are
they
right?
So
I
come
in
here
and
I
can
format
this
column.
A
If
we
take
a
look
at
this
format,
all
I'm
doing
is
that
index
of
right
here,
I've
seen
current
field
and
I'm.
Looking
for
the
calling
code
for
their
country-
and
this
is
for
the
tooltip
I'm
actually
putting
that
in
so
you
can
see
all
this
goes
and
I'm
just
nesting
those
conditions
they
get
a
bunch
of
closing
parentheses
at
the
end
here
right.
So
it's
just
if
it's
three
three,
no
three
five,
eight
that's
Finland
right
else
check
if
it's
Australian
so
on
and
so
on.
A
A
If
we
tried
to
do
you
know
a
traditional
way
of
doing
that,
which
would
be
a
basically
giant
switch
stay
where
you
looked
at
every
possible
phone
number
that'd
be
impossible
to
write
as
a
format,
but
by
using
starts
with
we
can
do
some
really
powerful
stuff.
So
let's
save
that
one
and
move
on
what
about
contains.
So
what
if
we
want
to,
we
want
to
see.
We've
got
a
few
of
these
are
dead
right.
Us
dude
is
dead
and
that's
very
sad.
A
We
want
to
make
sure
we
highlight
that
I
call
that
out,
so
we
don't
have
calling
them
and
there's
an
awkward
conversation
and,
of
course
it
over
the
talk
of
the
phone
very
well
anyway.
Alright,
so
we've
got
here
is
we've
got
our
contains.
So
text
contains
all
right:
we're
going
to
grab
this
we're
just
gonna
grab
this
guy,
and
it's
important
to
note
here
that
we're
not
just
doing
it
index
is
not
equal
to
negative
one.
So
basically
we're
reversing
that.
A
So
let's
actually
grab
a
version
of
that
over
here,
but
you
get
asked
it's
magic
all
right
stay
here,
so
what
I'm
doing
here
is
I'm
looking
for
the
index
of
the
inside
the
current
field,
I'm
looking
for
the
word
dead
and
I'm,
saying
not
equal
to
negative
one,
so
in
other
words
it
has
it
somewhere
inside
there.
It
has
the
word
dead
and
I'm
going
to
turn
it
red.
But
what's
important
to
note
is
this
one
down
here
because
it
has
a
capital.
A
D
doesn't
show
up
so
index
up
is
case-sensitive,
so
all
you
have
to
do
is
wrap
this
in
two
lowercase
wrap
that
around
our
current
field
for
dead,
and
we
preview
that
BAM.
Now
it
works.
Okay,
alright,
so
you
can
start
to
see
this
gets
really
really
powerful.
When
you
can
start
to
highlight
things,
you
can
apply
that
as
a
real
format
for
them
to
highlight
the
whole
row
based
on
that.
Now.
What
about
this?
A
So
one
of
the
things
that
motivate
them
all
to
select
choice,
columns
or
offset
people
fields
is
the
order
you
pick
them
matters
right.
You'll
see
that
some
of
these
are
finally
out
of
order,
depending
on
how
you
do
this,
it
gets
a
little
weird.
This
is
hard
to
to
read
in
the
aggregate
way
right.
Individual
list
items,
that's
great.
Let's
take
a
look
at
this
one,
so
all
I'm
doing
with
this
sample
or
MultiChoice
icons,
you
grab
all
this
I'm
just
doing
the
same
thing
over
and
over.
A
Let's
take
a
look
at
one
of
them,
we're
looking
for
an
icon
and
all
we're
doing
is
we
always
put
out
the
icon,
and
then
we
check
to
see
we
do
a
join
first
right
to
make
it
into
a
string,
because
you
can't
do
an
index
up
on
an
array.
We
join
it
first
and
then
we
look
for
it
doesn't
have
one
of
our
choices
and
if
it
does
so
not
equal
to
negative
one,
we
apply
a
theme
color
based
on
that.
So
let's
take
a
look.
A
We
format
this
column,
we're
gonna,
go
to
Advanced
Mode
I'm
gonna,
paste
that
in
here
preview
that
so
you
start
to
see.
Now
we
can
really
see
what's
happening
here
so
now
we
got
now.
I
can
easily
see
who
here
actually
drinks,
water
and
who's
into
the
beer
right
and
so
on
and
so
forth.
Alright,
that's
it!
That's
our
horse,
formatting
tips
for
you!
Oh
wait!
One
last
thing:
here's
some
resources
here.
A
So
as
a
reminder,
this
is
what
they're
for
the
documentation
for
this
is
not
yet
approved,
but
once
it
is,
you'll
see
it
so
it
been
submitted.
So
that's
over
here
right
there,
so
you
can
see.
We've
got
examples
of
all
these
operators
and
how
to
use
them.
So
that
is
coming
soon.
As
soon
as
that
PR
gets
approved,
you
can
see
how
to
do
all
that
all
right.
Let's
take
a
look
and
then,
lastly,
here's
some
resources.
There
are
also
samples
related
to
multi,
select
person
fields
so
check
those
out
as
well.