Using Tokens in Display Forms
I am trying to take a token - generated using the GenerateToken tool - and then use this token as part of my task url in a combobox or autocompletebox.
The generatetoken uses the variable 'tokenString', which I have added in the 'token' field within the combobox and autocompletebox.
What I don't know is how my Task URL should look. Before setting SSL on the server, I was using http://{domain}/arcgis/rest/services/{folder}/{mapservice}/MapServer/3
Besides changing HTTP to HTTPS, do I need to add something like token={tokenString} in order to run my workflows from the secure map services?
For info, my sites themselves are running nicely using the same secure map services, after setting the connection with a username and password. I am using the same user name and password to generate the token, so I am now at a bit of a loss. Both combobox and autocompletebox now do not display any selection options, and end up with a 400 bad request error. I also have the same 'tokenString' added further along in the workflow in a QueryTask, but I don't get that far using the simulator to know whether it is working correctly yet.
Any help would be great. Thanks,
Mick
-
Mick,
I've just had our local distributor help set me up with getting a simple autocomplete search back up and running now that I've enabled security on the services.
The task URL needed a /query? at the end... ie. ../ArcGIS/rest/services/mapscape/MapServer/6/query? (append this also to the Query Task Url of the queryTask activity also!)
also the form's runtime modifiction had an assign activity added
form.Find(Of AutoCompleteBoxFormItem)("AutoCompleteBox1").Token = tokenString <-- this is the token generated from the 'GenerateToken' activity
Not sure if this is 'the' way to do things, but it's working!
Others may have a better solution ; )
cheers
Gareth
0 -
Gareth,
Thanks for your reply. This is a big help. If I can hit you up for another answer, could you please let me if you simply entered "form.Find(Of AutoCompleteBoxFormItem)("AutoCompleteBox1").Token = tokenString" into the assign activity's 'vb expression' field, and used "form" for 'to'? I can't seem to get a valid vb expression for my autocompletebox - while 'to' and 'vb expression' appear to be valid, the assign tool itself says "Cannot assign for 'system.string' to type 'Geocortex.forms.client.formdefinition' in assign activity assign"
In the combobox, which looks for an id number I get "Cannot assign for 'system.boolean' to type 'Geocortex.forms.client.formdefinition' in assign activity assign"
I think I am missing something they teach in Workflow Designer 101 here, but not sure what.
Cheers,
Mick
0 -
Thanks again Gareth,
With your code and some help from our local distributor (your's too), I now have the runtime modification details correct and running nicely.
I did notice that one of my workflows was missing 'Geocortex.Forms.Client.Items', which caused errors with the assign function within the runtime modification even though everything was actually correct. Adding it to the list of imports fixed that.
Cheers,
Mick
0 -
No worries Mick - I did not realise till afterward that you are up the road - so to speak, so apologies for that, we should keep in contact!
Sounds like we're going through the same trials and tribulations ; )
Did you have to set up two tokens - client and server - as we had to? I'm currently doing some reading up on the web adapter we have installed and perhaps setting the authentication tier at the web level rather than AGS so I don't have to worry about tokens etc. Seems there's more than one way to skin a cat at 10.1, but what the best skinning approach is, is not exactly all that clear!
cheers
Gareth
0 -
I have only used a server side token set to the servers IP address, as these workflows will only be available from within our public facing site. Were you using a client token because you have users that are sending updates back? Our traffic is one way only.
We are just getting 10.1 onto our DEV machines at the moment, then loading Geocortex 3.14 so there is a whole new world of learning there. By setting authentication at web level, are you using username and password rather than tokens?
I will send you an email with my contact details shortly.
Cheers,
Mick
0 -
Thanks guys. This is an old post but it is still applicable. In 2018 you just have to supply the "token" variable you build usinging "GenerateToken" to the Query Tool (easy peasy). As you point out not the same for "Forms". This needs to be passed in runtime. Your guys code helped remind me of that! Screen shots for any future folks.
_img_ alt="Leave Token Empty in Form Builder" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=907f2000000k9hV&feoid=Body&refid=0EMf2000000fxbN" _/_img__img_ alt="Assign your "GenerateToken" to the proper Combobox via the Expression Editor" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=907f2000000k9hV&feoid=Body&refid=0EMf2000000fxbS" _/_img_0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
6 Kommentare