How do you display Server Connect Set Value on the front end?

I have a conditional function which checks for duplicates in an import csv file and if there are duplicates found it sets a value “duplicates” = “Duplicates found!”

For good measure I have also set a Response = 200 to stop the server connect at the point of identifying the duplicates.

I want to be able to turn this value into a notification on the front end to let the user know the file they tried to upload contains duplicates.

How do I do this??

Thanks!

I have tried adding an error code like 501 and then on the front end adding a server connect and on form submit Error showing the last error “message” but I just get the message “bad request”

I get the I got the error message to show but it must not be picking up the “Last Error” of the server connect.

I have done similar to what was done here: How to set other server responses for 'Server Connect' action

What is the correct way of doing this?

Response step removes all other output from the response. So the only thing you will see in response would be the text written in the response step.

Similar to what is suggested in the link you have shared, each response code has its own dynamic event in Wappler SC, and that should be used to show relevant message.

To identify where the message is in the SC, try checking response in network tab. It should be somewhere in sc1.data.lastError or sc1.data.response. Don’t remember this exactly.

1 Like

Thanks @sid
Fixed it.

I was looking in the wrong spot and choosing the wrong last error Response.

Thanks