Basically i would like to know how can i link a project to itself to use, calculate and display data collected on that same form.
For example im building a form to collect user data, and i want to validate if user exists or not to create a new user or modify existing user information.
Is there a way to do this using dynamic data attachment? ( i read the documentation but no examples on this particular case, i only see it connecting a parent to a child project) or is there any different approach for doing this?
This is definitely possible, bearing in mind the small delay needed to update the data that’s linked. As linking to a form requires that form to have some data submitted, linking a form to itself is a 2-step process. First create the form without any logic referencing itself - below is a super lightweight example.
Then upload at least one submission (even if with dummy data that you delete later), and after it’s uploaded, change the settings to set data sharing as enabled, and then select the form itself from the drop-down in ‘import other project data’ (all in the ‘connect projects’ page).
Now you should be able to add the logic where the form references itself. Below is the updated lightweight example that checks whether 1 or more records already exist with the user-inputted user ID.
For those having issues with this solution, just adding some follow-up clarifications:
Make sure that when you first upload the file, that it does not have any of the following (what I referred to in my earlier solution as ‘logic referencing itself’):
xml_external type questions
calculations or other fields with instance('<form-name>)/root/data... logic
Then once you have followed the steps in the solution above, you can then re-add these elements to your form
Hi, no worries - can you give me more information as to what you’ve tried, and what error messages are shown? Also if you’re able to upload an XLSform that would help
Say I want to check if a phone number has already been used in a survey and immediately flag that as data collection proceeds. Do I have to send the previous survey first so that the contact is in the database or is there a logic to check this even if the previous form is not synched?