Help with "sometimes visible"

Hi guys!

I’m having trouble with the “sometimes visible” option.

What I would like to do is:

  • Users need to submit a daily survey
  • If no survey has been submitted on that day, show a group with a CTA to the survey
  • If a survey has been submitted on that day, show a group with a succes message
  • If the next day starts, show the CTA survey untill it is submitted

I’ve tried the setup below:

  • Collection of Survey Responses has a “Date & time” in the, related to Users & Survey Submitted. Is created when a form is completed.
  • Collection of Survey Submitted, is related to Users & Survey responses. Is created when a form is completed.

CTA element with survey:

  • Sometimes visible
  • Will be visible if all survey submitted count is equal to or greater then 0
  • User is equal to logged in user
  • Survey response “Date & Time” is before start of today

And the reverse for the “succes element”:

  • Sometimes visible
  • Will be visible if all survey submitted count is equal to or greater then 0
  • User is equal to logged in user
  • Survey response “Date & Time” is after start of today

Anyone know how I could get the desired effect?

This absolutely should be possible, but it’s quite hard to follow your explanation - could you upload screenshots of your collection items for Surveys, Survey Responses and Survey Submitteds?

Thanks for your reply Darragh. I’ve included some more screenshots, also from the actual set up in Adalo. (Post in 2 parts because of a 5 images per post limit).

Please find below the collection items:

Survey responses: the collection contains answers to the survey questions + date of survey submitted. It is created when a survey is submitted.

Survey submitted: the collection is created when a survey is submitted. So an entry in both the “survey responses” collection & the "survey submitted collection is created.
Screenshot 2020-04-29 at 12.24.22

How it’s set up:

I would like the element below be visible when:

  • No survey responses are submitted yet for that user (e.g. at the very first session)
  • When no survey responses are submitted for that user for that day
    I would like the element to hide when:
  • A survey reponse is submitted for that user for that day
    Screenshot 2020-04-29 at 12.34.06

How the visibility is set up in Adalo:

My rationale for setting up: show it when responses are 0, or the submission date of the “survey responses” collection is before the start of today.

I would like this element to be visible when:

  • A survey response is submitted for a user for that day.
    I would like the element to hide when:
  • No survey response is submitted for a user for that day
    Screenshot 2020-04-29 at 12.43.48

How the visibility is set up in Adalo:

And again my rationale: show this element when survey submits are equal or greater than 1 when the submission date of the “survey responses” collection is after the start of today.

Problem with the setup above is that both elements show after a survey submission, and that I’m unsure if the filter “survey response date” before the “start of today” is working. How would the set up be to get the desired effect? (being: an user needs to fill in a survey daily. If no responses have been recorded that day, show the CTA. If a response have been recorded, show the “thanks” message. If a new day starts, reset.)

If anything above is unclear, please let me know. Happy to clarify.

Thanks for your help!

Hi Bart,

Would something as simple as adding a date & time field to the user (‘last survey submitted on’) help with this? Each time the user submits a survey response, you update this date to the current date. You then have another conditional display option.

This can be used as follows:

That is working! Apparently no need for count statements for this case. Thanks alot!

1 Like