Skip to main content
Solved

FSM: Use client script sql in Data Source Designer

  • November 25, 2019
  • 4 replies
  • 511 views

josdepijper
Hero (Partner)
Forum|alt.badge.img+12

Could it be, that Client Script Sql in FSM does not work yet? I can not get it up and running and there is no documentation for it.

 

Best answer by Jon Reid

The client script data source in Lobby refers to a client script you would create in Studio->Client Scripts.   The Client Script SQL screen identifies a SQL statement called by the GetDBValue() method within a client script.    So you would need to create a client script then call your TEST client script sql within your script like this:

var personIDs = getDBValue('TEST');

You don’t have a WHERE clause on your client script SQL so I’m not sure what you’re expecting - the list of person ids could be quite large in customer databases.

View original
Did this topic help you find an answer to your question?

4 replies

Jon Reid
Hero (Employee)
Forum|alt.badge.img+18
  • Hero (Employee)
  • 224 replies
  • November 26, 2019

yes it works - we use it in baseline as well as for customer scripts.   what version are you running and what specifically are you trying to do?

 


josdepijper
Hero (Partner)
Forum|alt.badge.img+12
  • Author
  • Hero (Partner)
  • 67 replies
  • November 26, 2019

Hi Jon, That is great to hear. I am running version 6.3. I just would like to see it working as a proof of concept, which is hard because there is no specific documentation about this. What I am trying to do is creating a new Data Source from the Data Source Designer of the type “Script”. From there I have to fill in a ‘Script ID’. I expect this field should be filled in with the Client Script Sql ID of a Client Script Sql (just a guess, because again there is no documentation that describes this feature). Then I expected that I could run a preview in the preview window and that in this window should appear some data coming from my custom sql statement in my Client Script Sql.

However it only shows a column named “return” with no data. 

The Client Script Sql contains a simple sql statement like:

select person_id from person

So I expected the Data Source should give me then all the records of the column person_id of the table person. I kept it really simple, because at first I just would like to see it work, as I already mentioned.


Jon Reid
Hero (Employee)
Forum|alt.badge.img+18
  • Hero (Employee)
  • 224 replies
  • Answer
  • November 28, 2019

The client script data source in Lobby refers to a client script you would create in Studio->Client Scripts.   The Client Script SQL screen identifies a SQL statement called by the GetDBValue() method within a client script.    So you would need to create a client script then call your TEST client script sql within your script like this:

var personIDs = getDBValue('TEST');

You don’t have a WHERE clause on your client script SQL so I’m not sure what you’re expecting - the list of person ids could be quite large in customer databases.


josdepijper
Hero (Partner)
Forum|alt.badge.img+12
  • Author
  • Hero (Partner)
  • 67 replies
  • December 2, 2019

Thanks Jon,

Is it also possible to display the result of the Data Source in a list element from the element designer? For example. Show me a list of all personid’s.

I Am trying this in the Metrix demo environment so there are a limited records in the Person table. I am just doing this for a proof of concept matter.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings