I want to publish a portal to collect public data (no registration required)
PDF
Discussion posts and replies are publicly visible
While publishing this portal, did you map a service account that will be used to trigger this integration?Let's try to understand how the portal works. The public portals are basically accessed outside your Appian environment and hence if your interface has a static block of code, it will work just fine. But if it has any dynamic code, as you have in your case - Integration, then it will require to interact with the Appian env. Now because right now you're not authenticated in the env, you will have to use some auth mechanism to trigger the integration.
You can also check out the course of the portal on Academy. It's just 15 mins long and should give you a good idea.