Question

FSM 6.5 Scripted Lobby Tile


Userlevel 3
Badge +8

Hello,

I’m trying to create a lobby tile with a scripted data source. (FSM 6.5)

My Client Script SQL and Client script are both working.  I can preview my data source from the data source designer screen and see the result from my script.  The script is returning a single number and appears to be in a column named “return”.

I’m struggling to get the number returned from the data source to be displayed in the actual element tile.  There is just a big X where the number should be.

Since this is my first scripted lobby tile I must be missing a step somewhere. 

Anyone know what it could be?

 

Thanks!

 


10 replies

Userlevel 6
Badge +26

Hi @csanders 

Try creating your basic table without aggregations.

Use the aggregate function on the element designer.

 

For example, your script might return a task subset

Select task_id, task_status from task
where task_status = 'OPEN'

Then you aggregate by task_id and use one of the functions

Cheers!

Userlevel 3
Badge +8

@Shneor Cheshin Thanks for the reply!

 

In the element designer when I select a script type data source the Column and Aggregate options disappear off the screen.

 

The data source designer shows that my script is returning the value of 63

 

But this is what the preview of the tile looks like in the element designer.

 

It seems like it should be working.  Any other ideas?

Userlevel 6
Badge +26

@csanders 

As I advised. Create a table/view with no aggregations. So it will return records and not a number.

The aggregation configure in the element.

Cheers!

Userlevel 3
Badge +8

@Shneor Cheshin,  I realize I could create a view and make this tile work the way all of my other tiles do.  I really just wanted to see what I could do with a script data source.  So far I can’t get them to work at all.

I’d  be happy with any example of a scripted data source working.

Thanks again.

Userlevel 6
Badge +26

@csanders 

Please share your data source.

Cheers!

Userlevel 3
Badge +8

@Shneor Cheshin  No Problem,

This is the XML for my data source.

<ClientScriptDataSource>
<Author>CSANDERS</Author>
<Keywords>hsa</Keywords>
<DescriptiveText>Workorder closing errors in the last 30 days</DescriptiveText>
<LastModified>9/1/2022 1:12:02 PM</LastModified>
<IsCustom>true</IsCustom>
<IsReadOnly>false</IsReadOnly>
<PackageExtractAction>EXTRACT</PackageExtractAction>
<PackageExtractGroup />
<Name>HFO HSA Errors</Name>
<ID>523acdb2-2e16-4428-9e25-d56ce311b345</ID>
<Select>
<DataColumn>
<Column>return</Column>
<Name>return</Name>
</DataColumn>
</Select>
<ScriptId>GOS_LOBBY_HSA_ERRORS</ScriptId>
<Version>1</Version>
</ClientScriptDataSource>

This is my script which is currently returning a value of “63”

Script Name: GOS_LOBBY_HSA_ERRORS (Version 1)

var worksFrom = getUserInfo('WorksFromPlace');
return getDBValue('LOBBY_HSA_ERRORS', worksFrom);

 

Userlevel 6
Badge +26

Hey @csanders 

I am trying to understand your query.

Can you please share that? Maybe it is implemented in ‘GOS_LOBBY_HSA_ERRORS’?!

Cheers!

Userlevel 3
Badge +8

@Shneor Cheshin Instead of getting hung up on the query, I modified my script to just return “10” (With no query).  How can I get the tile to show 10 now?  Thanks.

 

 

It shows “10” in the data source designer.
 

 

Element designer preview still shows an X.
 

 

Userlevel 6
Badge +26

@csanders 

That is the point. I am trying to suggest you with a workaround.

I am not sure why it is not showing, might be a bug? I suggest to open a support call for this issue.

As a workaround, Instead of returning a number, I suggest you use SQL to return a table of records and aggregate the results in the element itself.

Cheers!

Userlevel 3
Badge +8

@Shneor Cheshin, as I said before when I select a script type data source from the element designer the aggregate option in element designer disappear from the screen, so there’s no way to do what you suggest.  I could get this tile working with a different type of data source.  Using a script data source was the entire point for me.  Thanks for your help, I agree that this seems like a bug.

 

Reply