Hi all, when enabling Formula-level error management I'm getting the error "The second argument to the 'Replace' function must be greater than or equal to 1"
The below formula is what it is referring to which appears to be working as expected. I didn't create the app originally but am maintaining it and I wanted to enable the error management to handle NULL values. Any ideas?
Concatenate(
"Something went wrong with a previous attempt to save the report. Click below to go back to the report and check the following sections for completeness: ",
Replace(lclMissingListItemNames,Len(lclMissingListItemNames)-1,Len(lclMissingListItemNames),".")
)
TIA
Paul
Thanks Carlos solution helps tremendously and works perfectly.
As the error message suggests, the second parameter to the Replace function must be at least 1, so if the length of the lclMissingListItemNames variable is less than 2 (or it is blank, in which case it would have a length of 0), then you will see this error. With 'Formula-level error management' disabled you would get a blank value instead of the error. There are a few ways you can solve this:
Notice that you can simplify those expressions with the With function so that you won't need to repeat the same expression multiple times:
Hope this helps!
Stay up to date on forum activity by subscribing.
stampcoin
73
DS-11051211-0
20
MS.Ragavendar
9