AnsweredAssumed Answered

If Then Statement and Auto Increment

Question asked by craigp22 on Jul 20, 2020
Latest reply on Jul 22, 2020 by craigp22



I have a particular workflow that I'm trying to determine the best approach for. 


In Survey 123 Connect, I have a 'Description/WIP' dropdown question in which the user needs to first select:



After selecting the desired 'Description/WIP', there is another field ('Container Number') which contains a defined value based on the 'Description/WIP' selection using the following fomula:


if(${Description}='AEROSOL', 'abc', if(${Description}='PAINT CAN', 'xyz',''))



What I am trying to figure out is adding a sequential value after 'xyz'.  For example, the first time the 'Container Number' field would fill 'xyz1' the first time 'AEROSOL' is selected in the 'Description/WIP' field.  The next time that they use the survey and if they happen to select 'AEROSOL' again, the 'Container Number' would then fill 'xyz2'.


I have tried creating hidden integer fields for each 'Description/WIP' and have that auto increment using an if then statement without any success up to this point.


If anyone has any suggestions or recommendations, they would be greatly appreciated.


Thanks in advance,