How to provide a check for duplicate data collection of a field that was collected by other user in less than 24hr

1716
4
Jump to solution
09-16-2019 04:02 AM
SusanMathai
New Contributor III

How to check if a location was checked in last 24hrs and avoid duplicate entry

0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

Hi Susan,

Are the other surveys collected by different users on different devices at different time that you want to check? If so, the only place you can query for this information is against the feature service once the records have been sent. There is no way from Survey123 to query against the feature service for this information out of the box from within the survey form once it is opened.

Using JavaScript functions however, you may be able to achieve this by writing your own custom JS function. You can find out more about this beta feature here.

Regards,

Phil.

View solution in original post

4 Replies
by Anonymous User
Not applicable

Hi Susan,

Are the other surveys collected by different users on different devices at different time that you want to check? If so, the only place you can query for this information is against the feature service once the records have been sent. There is no way from Survey123 to query against the feature service for this information out of the box from within the survey form once it is opened.

Using JavaScript functions however, you may be able to achieve this by writing your own custom JS function. You can find out more about this beta feature here.

Regards,

Phil.

SusanMathai
New Contributor III

Hello Philip,

Yes surveys are collected by different users on different devices at different time.

Thanks for the reply Philip! 

0 Kudos
DougBrowning
MVP Esteemed Contributor

Once they all sync you could use an Arcade expression to check in Collector.

I do this to make sure they did all 3 lines.  I really wished it worked offline but for now 123 must sync up for Collector to see it.

Arcade in a Collector popup (I make it red text in the pop up so that it gives a red error or is just blank)

What it does is query another layer in the map, then looks to see if there is a Line 1, 2, and 3 for this plot.

if ($feature.EvalStatus == "Eval") {
var sql = "PlotKey = '" + $feature.PlotKey + "'";
var tbl = Filter(FeatureSetByName($map,"GAP"), sql);

var txt = ''
for (var f in OrderBy(tbl,"LineNumber")) {
    txt = txt + f.LineNumber + ' '
}
txt = Left(txt,Count(txt)-1)
if (txt != '1 2 3') {
    return "\n----Gap Line Number Issue! Found: " + txt
}
else {
    return ''
}
}
else {
    return ''
}

Hope it helps

0 Kudos
DanCall1
New Contributor II

Hi Phil:

You mention that this isn't possible if the users are on different devices, which makes sense, but is it possible to prevent duplicate entries over a specific time window by *one* user on a single device?

We're using Survey123 to record the loading of road salt into salt-spreading trucks. Since it takes the trucks a minimum of about 30 minutes to leave the salt station, spread their salt, and come back, I'd like to prevent the same truck ID from being recorded more than once in 30 minutes. There is only one Survey123 user per salt station, so I only need to check against surveys they've submitted, not the entire dataset.

0 Kudos