Is it possible within a survey123 smart form to notify the surveyor if a survey on the same site was done in last 15days?

1022
2
Jump to solution
05-10-2023 11:24 AM
LemuelM-MDC
New Contributor II

Hi All,

Is it possible within a survey123 smart form to notify the surveyor if a survey on the same site was done in the last 15 days?

Thank you in advance.

Lemuel M.

0 Kudos
1 Solution

Accepted Solutions
IsmaelChivite
Esri Notable Contributor

Yes.

You will need to use the pulldata("@layer") function for this.  I attached an XLSForm example.

Notes:

  • The pulldata function allows you to query a layer. You will want to query the inspection's layer with a query that looks something like this:

assetID='100' and inspectionDate BETWEEN CURRENT_TIMESTAMP - 15 AND CURRENT_TIMESTAMP

  • For your pulldata query to work, your survey layer MUST allow the query operation
  • The pulldata("@layer") function only works when you are connected (it will not work while offline)

To setup the XLSForm:

  • Take the attached XLSForm, load it into Survey123 Connect and publish it
  • Go into the item details page of the survey layer created by Survey123 Connect and make sure you enable queries in your surveys layer
  • Get the URL of your layer and replace it in row 8 of yourXLSForm. Re-publish your survey and use either a web browser or the mobile app to add one or more records to test.

Hope it helps.

View solution in original post

2 Replies
IsmaelChivite
Esri Notable Contributor

Yes.

You will need to use the pulldata("@layer") function for this.  I attached an XLSForm example.

Notes:

  • The pulldata function allows you to query a layer. You will want to query the inspection's layer with a query that looks something like this:

assetID='100' and inspectionDate BETWEEN CURRENT_TIMESTAMP - 15 AND CURRENT_TIMESTAMP

  • For your pulldata query to work, your survey layer MUST allow the query operation
  • The pulldata("@layer") function only works when you are connected (it will not work while offline)

To setup the XLSForm:

  • Take the attached XLSForm, load it into Survey123 Connect and publish it
  • Go into the item details page of the survey layer created by Survey123 Connect and make sure you enable queries in your surveys layer
  • Get the URL of your layer and replace it in row 8 of yourXLSForm. Re-publish your survey and use either a web browser or the mobile app to add one or more records to test.

Hope it helps.

LemuelM-MDC
New Contributor II

Thank you so much Ismael. This works beautifully. The sample survey with your instructions helped a lot too. I will just let the user making the request know that the function would only works while online, and let him pick. Thanks again.

Best Regards.

0 Kudos