Limiting Overview or Inbox records to the user to submitted them?

500
4
05-24-2023 10:24 AM
DaveK
by
Occasional Contributor

Hello! 

Is it possible to limit the records submitted through the Survey123 desktop app to the users who submitted them? Currently any user can see all submitted records via the Inbox or Overview box within the app. 

Any help is appreciated.

Thanks. 

Tags (3)
0 Kudos
4 Replies
jcarlson
MVP Esteemed Contributor

You can set your service settings to only show features to users who create them:

jcarlson_0-1684951742878.png

This would effectively limit the Inbox / Overview in the way you want. If you need to see all the data in other contexts, you can create different views of the feature service with different settings.

- Josh Carlson
Kendall County GIS
0 Kudos
abureaux
MVP Regular Contributor

Alternavite solution is to use a WHERE clause. 

Go to the Options page, and enter your WHERE clause. The Learn more button gives you instructions on limiting the inbox to a person.

abureaux_0-1684957840468.png

 

0 Kudos
jcarlson
MVP Esteemed Contributor

Does that work with editor tracking fields not present in the form? And does ${username} actually get the logged in user's name?

- Josh Carlson
Kendall County GIS
0 Kudos
abureaux
MVP Regular Contributor

Short answers:

Does that work with editor tracking fields not present in the form?
Yes.

does ${username} actually get the logged in user's name
Yes.


Longer answer, because it may be of interest.

abureaux_4-1684960091770.png

The second half of this query is easy. ${username} will always be the username of the person signed into the app. If someone isn't signed in, this is blank.

The first half is straight-forward, but potentially complicated. It is a field you specify in S123. To get data into this field, you have a few options:

  1.  Use the method built into S123 to grab the username (Note: name/label can be anything you want). The setup below will contain the user's username if they are logged in, or be blank if they are not.

    abureaux_0-1684958776680.png

  2. Have the user enter their username manually (e.g., a dropdown)
  3. Use both options 1 and 2.

I have personally settled on using Option 3 going forward.

Reason: Users go out into the field and may not be logged in when the form first opens, meaning their username is blank. This has resulted in "missing" data, and me manually filling in the missing username in Portal.

Explanation: If the user is signed in, then the field gn_assessor (which is required) will contain their username. If they are not signed in, gn_assessor will be empty--if they try to submit the form, they will be prompted to enter their username here by selecting from a dropdown.

Set-up:

abureaux_3-1684959813157.png

Line in ExcelnamevisiblePurpose
2header_usernamenoA special field built into S123. This will pull the username of the person signed in. 
41gn_assessoryes

An external select I set up containing all staff in the company. Has a calculate to pull the value of ${username_email1}

42username_email1no

A containor for ${header_username}. I theoretically could just pull directly from ${header_username}, but this made writing the calculates easier.

43username_email2no

Pulls the email from my external CSV based on the selection made in ${gn_assessor}

44username_email_hno

I use coalesce to ensure this field always has a "username" (In my case, an email). If ${username_email1} is blank, coalesce() = ${username_email2}. If ${username_email1} is not blank, coalesce() = ${username_email1}

45-48<varies>no

Just there to complete the example. I am pulling user information from my external CSV based on the email in ${gn_assessor}

 

And this is generally how the external CSV is set-up:

abureaux_5-1684960994349.png