Stuart Moscoe:
I have a problem with some form submissions.
Occasionally a user will submit a form, but their user id is blank in the BF helper inbox record. (see the inbox values below)
This creates a problem when processing the form since it cannot be linked to the correct user and company.
In the script that saves the form submission, one of the script steps gets the id from the $$BF_User.
However, the $$BF_User is empty when this form was submitted.
Set Variable [ $id_betterforms ; Value: JSONGetElement ( $$BF_User ; "id" ) ]
Does anyone know what would cause this?
Could it be a user login timeout issue?
Is there a way to trap for this error and tell the user to resubmit the form?
Blank user value below in the BF helper inbox.
"user" : {},
"version" :
{
"version" : "10.1",
"versionIsLatest" : false
}
regular user value
"user" :
{
"id" : "BFU-9BA88ABA-D0C3-2347-8469-A9190B7BB28B"
},
"version" :
{
"version" : "10.1",
"versionIsLatest" : false
}
Linxue Ren:
Could be a timed out issue. You can add validation to check if $$BF_User has “id”, and if not send alert message tell user login expired by our customized function BF_SetAction_showAlert( title ; type ; text ; options )
Neil Manchester:
I created a Redirect to Login script with the steps in the attached screenshot and placed this at the top of the BF - Common Dispatch script.
Stuart Moscoe:
@Linxue Ren @Neil Manchester
Thanks for your reply. I have configured my script using parts of your answers.
I have tested the code in Filemaker using the “Run Hook” button in the BF helpder file. The code exists as it should.
How can I test this on my site to ensure it works? How can I expire my session?
Neil Manchester:
Put a Set variable script step at the start of the Redirect to Logion script to set $$BF_User to “”. Then on the front of your BF app just complete any action and it will replicate a call where $$BF_User is empty and should redirect you. Once you’ve tested delete the Set variable step