Hi @ClarkyPA365
Okay so are the Email, Staff Name, Ward Name, Division fields always the same number of items?
Like if there are 3 Emails, there should always be 3 Staff Names?
And then Supervisor, Supervisor Email and Supervision Type is always one item?
If so then you can get the count of one of fields that have multiple items. And from that count, use a ForAll to
patch each of them.
With({RowCount: CountRows(Split(EmailFieldControlName,","))},
ForAll(Sequence(RowCount),
Patch(YourDataSourceHere,Defaults(YourDataSourceHere),
{
Supervisor: SupervisorControlName.Text,
SupervisorType: SupervisorTypeControlName.Text,
Email: Last(FirstN(Split(EmailFieldControlName,","),RowCount))
SupervisorEmail: SupervisorEmailControlName.Text,
StaffName: Last(FirstN(Split(StaffNameFieldControlName,","),RowCount)),
WardName: Last(FirstN(Split(WardNameFieldControlName,","),RowCount)),
Division: Last(FirstN(Split(DivisionFieldControlName,","),RowCount)),
}
)
)
)
In this example code, you will get the same Supervisor for all rows because you set it the same for all 3. And
then in the fields such as Email, it will get a specific row in the split according to the number used in the ForAll. In this formula I am using the With function to set a variable so that I don't have write the whole countrows over again