
I need to know how to make 'ThisRecord._SNValve work in a nested ForAll()
ClearCollect(NextDataItems,
FirstN(
Filter( temporary_assign_wo, Updated<>2 && !IsBlank(_SNValve) ),
Value(TextInput6.Text)));
ForAll(NextDataItems.Index,Patch(NextDataItems,ThisRecord,{SN_List:Match(
Concat(
ForAll(
TrimEnds(
Split(
Substitute(ThisRecord._SNValve,";",","),
","
)
).Result,
If(
IsBlank(Find("-",ThisRecord.Result)),
ThisRecord.Result,
If(SN_Prefix_2.Text="",
Match(Concat(
Sequence(Value(Last(Split(ThisRecord.Result,"-").Result).Result)-Value(First(Split(ThisRecord.Result,"-").Result).Result)+1,
Value(First(Split(ThisRecord.Result,"-").Result).Result),1).Value,
Concatenate(Text(Value),",")
),
"^(?<trim>.*),$"
).trim,
Match(Concat(
Sequence(Value(Last(Split(Last(Split(ThisRecord.Result,"-").Result).Result,SN_Prefix_2.Text)).Result)-Value(Last(Split(First(Split(ThisRecord.Result,"-").Result).Result,SN_Prefix_2.Text)).Result)+1,
Value(Last(Split(First(Split(ThisRecord.Result,"-").Result).Result,SN_Prefix_2.Text)).Result),1).Value,
Concatenate(SN_Prefix_2.Text,Text(Value),",")
),
"^(?<trim>.*),$"
).trim
))
),
Concatenate(Value,",")
),
"^(?<trim>.*),$"
).trim}))
I have an issue with the Substitute() statement. I get this:
The statement works in the context of a label in a gallery. I pulled this out of the gallery, and had to change a couple elements. It all looks good except for this.
Have you tried working the As operator into your code to help with scope:?
ForAll(NextDataItems.Index As aItem,Patch(NextDataItems,aItem,{SN_List:Match(
Concat(
ForAll(
TrimEnds(
Split(
Substitute(aItem._SNValve,";",","),
","
)
.
.
.
You can use unique As references for each nested ForAll to give context that ThisRecord can't do on its own.
Hope that helps,
Bryan