Restrict duplicates on looping with actions

Hi,

I have an app that sets worker’s availability.
I have managed to add multiple records at once following the instructions in the article below.

Article

Add any number of rows from any row within a table

The problem I have is that once a set of available dates are set for a worker, there is nothing restricting the user from adding again the same dates for the same worker, this way ending up with multiple records for the same worker for the same day.

Tables

Workers Table

Bridge Table - used for looping details

The EnumList has the following ValidIF formula:

LIST([DR_WeekStart],[DR_WeekStart]+1,[DR_WeekStart]+2,[DR_WeekStart]+3,[DR_WeekStart]+4,[DR_WeekStart]+5,[DR_WeekStart]+6)

The user will set the availability dates for a week at a time.

Week Start column solves the problem of some starting the week on Sunday while others on Monday.
Basically, 7 days from the selected Week Start

Availability Table

The actual loop is between the Bridge Table and Availability Table.

Actions

LINKTOFORM on Workers Table

Looping Actions

Add One Row

Decrement COUNT

Decrement COUNT

For Each Row Do This

foreachrowdothis

Add More Rows

addmorerows

I am thinking of having a column [Test] on the Availability Table with a formula like

CONCATENATE([Worker],[Date])

…and then somehow have a condition on Add One Row action to check all concatenations of Worker and selected dates in the Enum List column in the Bridge Table against the [Test] column from Availability Table

This is where I am stuck!
Can’t figure it out how to do it.

Thanks a lot!

@Steve

1 Like
LIST(...) - SELECT(table[date-column], expression-that-matches-worker's-current-commitments)

See also:

1 Like