Select to view content in your preferred language

Warn User they Submitted a NULL Repeat

881
4
Jump to solution
11-02-2023 06:15 AM
jzibbell_boise
Regular Contributor

It is easy for users to accidentally submit a blank repeat. I am trying to create a note that warns users they've submitted a blank note. I have first created a hidden repeat count field, count(${sprinklers}) + 1. The count starts at 0, so I've added a plus 1. I've added this field to the label so users can see how many non-null notes they have total. Then I've taken the repeat field ${sprinklers} and made a relevant statement below that if the string length is zero and the sprinkler count is greater than 1, then show a note that says "You submitted a blank note". But I can't get it to behave because if they populate the first note then every new page after that will warn them there is a blank note before they even have the chance to add it in.

string-length(${sprinklers})=0  and ${sprinklernote_count}>1

0 Kudos
1 Solution

Accepted Solutions
SpatialSean
Regular Contributor

You can likely use the position(..) formula

string-length(${sprinklers})=0  and ${sprinklernote_count}=position(..)

This should look at the current note and see if it is blank

View solution in original post

4 Replies
IsmaelChivite
Esri Notable Contributor

I wonder if making the note question within the repeat required would be an acceptable solution for you.

0 Kudos
jzibbell_boise
Regular Contributor

Thanks Ismael, a response isn't required, that would be frustrating for users. I figured out I would deploy the count and then the user could see that the title says Note #1 but they can see in the pagination that they're on two? I'd rather build some warnings, but struggling with what I described in my initial post.

 

jzibbell_boise_0-1698960743663.png

 

0 Kudos
SpatialSean
Regular Contributor

You can likely use the position(..) formula

string-length(${sprinklers})=0  and ${sprinklernote_count}=position(..)

This should look at the current note and see if it is blank

jzibbell_boise
Regular Contributor

I really like when I get a win on a Friday afternoon! I'll hide the count and index of course, but that did the trick. Thank you!

 

jzibbell_boise_0-1699044784018.png

 

0 Kudos