Hello,
I'm hoping this is a relatively easy yes this is possible/no it is not possible type question! I've had a search online and cannot find anyone with a similar query/cannot phrase the question in such a way that I get the answer I'm looking for.
I'm currently working on a S123 form where I am collecting data across 5 quadrants, I have created these as repeats and set the repeat count to 5. I have a Quadrant Reference field where the user currently manually selects the Quadrant number but what I would like to do is have this set by the repeat number, so as someone switches over to repeat number 2 the Quadrant Ref would change to 2 etc.
The nature of the form means there's a fair bit of navigating between Quadrants and we need to ensure that the correct Quadrant Reference is populated at all times. Is it therefore possible to have the Quadrant Reference field calculated by the repeat number.
Thanks in advance.
Tom
Solved! Go to Solution.
Yes I do this.
First create two fields. One with a calc of 1 and the other that counts this 1 using once so that it does not change if you go backwards in the repeat.
type name label Calculation
hidden RepeatCount RepeatCount 1
calculate TransectNum TransectNum once(count(${RepeatCount}))
Then use this count number to do a lookup to a csv to get your value.
type name label Calculation
note Transect Transect pulldata('TransectCodesMid', 'TransectLetter', 'TransectNum', ${TransectNum})
pulldata is like this (csv name, return column, lookup column, field with lookup value)
The csv is a lookup of number and value (mine was a simple A-D but it could be anything). This csv goes in the media folder.
TransectNum TransectLetter
1 A
2 B
3 C
4 D
I have also done things like
1 Left
2 Right
I use it all the time. The only time it was weird is if I am in a repeat that is within a repeat. See my post from yesterday on this.
I hope this helps.
Yes I do this.
First create two fields. One with a calc of 1 and the other that counts this 1 using once so that it does not change if you go backwards in the repeat.
type name label Calculation
hidden RepeatCount RepeatCount 1
calculate TransectNum TransectNum once(count(${RepeatCount}))
Then use this count number to do a lookup to a csv to get your value.
type name label Calculation
note Transect Transect pulldata('TransectCodesMid', 'TransectLetter', 'TransectNum', ${TransectNum})
pulldata is like this (csv name, return column, lookup column, field with lookup value)
The csv is a lookup of number and value (mine was a simple A-D but it could be anything). This csv goes in the media folder.
TransectNum TransectLetter
1 A
2 B
3 C
4 D
I have also done things like
1 Left
2 Right
I use it all the time. The only time it was weird is if I am in a repeat that is within a repeat. See my post from yesterday on this.
I hope this helps.
Hi Doug,
Thanks for the reply, very helpful and has achieved what I was after! Luckily my transects needed to be labelled 1-5 so I did not have to use the pulldata function.
I did need to pull the number into a repeat but I circumnavigated any issue by pointing to the calculated value which seemed to work.
Tom
Note you can now use position(..) or position(${repeatname}) if nested.
Also note that if a user goes back a few repeats and deletes, then adds a new record you can get dups.