Slice Data Based on Field Contains

Hi Everyone,

I am currently building a workforce management app where the user submits a placement, start date, end date, and set days. A series of actions then create a row form each day in between and also add what day name that date is.

I am trying to create a slice that only shows the row where the Set Days contains the same value as the new day name value. This will then remove any dates where the placement is not one of the individual’s set days.

I would really appreciate help with the expression, I have tried IF statement but this makes only the first row as Y, so if the set day is Thursday, Friday, it will only bring in Thursday as the first value;

ifs(CONTAINS([Set Days],“Monday”),[Day]=“Monday”,

CONTAINS([Set Days],“Tuesday”),[Day]=“Tuesday”,

CONTAINS([Set Days],“Wednesday”),[Day]=“Wednesday”,

CONTAINS([Set Days],“Thursday”),[Day]=“Thursday”,

CONTAINS([Set Days],“Friday”),[Day]=“Friday”)

Any help would be greatly appreciated,

Thank you

Maybe this?

IN([Day], [Set Days])
1 Like

Thanks, Steve for getting back to me,

I have found all of your posts on the community very helpful,

When using,

IN([Day], [Set Days])

I am getting the following error

Parameter 2 of function IN is of the wrong type

Is there anything else I need to do?

3 Likes

What is the column type of the Set Days column? That it’s plural suggests it may contain several days.

1 Like

Apologies yes it is a text enum list that users can select multiple days, the output is therefore ‘Monday, Tuesday’

1 Like

Please post a screenshot of the table’s column list from Data >> Columns in the app editor, including at least the Day and Set Days columns.

Please also post a screenshot of the slice configuration.

1 Like

Thanks Steve,

Below is my table configuration;

Again thanks for your help,

Best Wishes
James

1 Like

For my slice, I have had to compromise to create a separate slice for each day, but it’s not ideal as it means creating 5 tables,

Change to EnumList of base type Text with values of the allowable weekday names:

image

2 Likes

That has done the trick thanks for your help Steve! :slight_smile:

I was wondering, no problem if not, how do I go about adding something like the following into the IN statement;

WEEKNUM([Date]) = WEEKNUM(TODAY())

Thanks again

3 Likes

Perfect thank you for all your help

1 Like