Output for SQL connector call
-
KseniaHas successfully completed the online course Basics (100)4 years ago #23307
Dear community,
I have a similar topic to Robert’s post on January 11, 2019 regarding displaying an output from a SQL connector call in my app. Likewise Robert, I have created a SQL connector. Its connector call is tested and running. Also, I sticked to the example app (ITIZ_Template_SQL_ShoppingList) in building everything. However, when deploying my app (containing a search field and a text field for the returned value) I can see the results in the inspector but it doesn’t get displayed in my text field. My team and I figured out that the connector returns an array containing objects but the text field accepts only a string. So we made a work around by attaching a script that does the transformation.
But that surely isn’t the solution and I must have missed something?
Attachments:
You must be logged in to view attached files.Klaus794 years ago #23565::Hi Ksenia,
you can do that mapping directly in process designer when calling your connector “CWTool->getLand” assuming that your output parameter in the getLand call of your connector has a variable of type json object (structure) or a simple string type.
If you have an input field on your screen I assume that you’re expecting not several values (no array) as output from your connector.
If not use a table instead of the input field. Then you can map the array of the connector result to the items (e.g. columnlistItems) of the table.
Best regards
Klaus
Armin WinklerHas successfully completed the online course IntroductionHas successfully completed the online course Intermediate (200)Has successfully completed the online course Advanced (300)Has successfully completed the online course Basics (100)3 years ago #24477::Hi Ksenia,
as your output seems to be of a collection type (which resembles a Javascript object), you can also navigate directly into your output structure when specifying the output parameters in your SQL connector call. However, this will only work, if the field you want to access within your output has a static position, e.g. it is always part of the first object included in the array under the same key, no matter the input of your SQL query. Then you could specify your output parameter like the following:
/[indexInArray]/keyInObject
What you see above is basically the path to the field within your structure, starting from the very top (which is the “/” or root, respectively). Please remember to adapt the data type of your output parameter accordingly as you won’t get a collection returned anymore but the simple datatype of the field itself, like string or integer.
If the position of the value within your output structure should not be static, I would suggest to access it dynamically from within a business object that executes the connector call. Here is how to achieve this. Using the business object is of course not really different from your script-based solution, so please keep that in mind.
Regards,
Armin
You must be logged in to reply to this topic.