Skip to main content
Jun 20, 2023 6:34 PM UTC

SQL Table Editor - Set selected record from a rule?

I have a SQL Table Editor on a dashboard, I would like a row to be "pre-selected" from code instead of through a user action (manually clicking on the record).

Is this possible?

 

13 replies

Veteran
Jun 21, 2023 8:20 AM UTC

Hi SeanV 
I do not exactly understand your request. Please could you be more specific and even show so print screen.
Hope it will help the community to help you.
Thanks

SeanVAuthor
Jun 21, 2023 1:16 PM UTC

I have a SQL Table Editor on a Dashboard and a button.    Users select (click on a row/record) on the SQL Table Editor then click the button.  The button runs a Dashboard Extender rule that does "stuff" based on the selection from the SQL Table Editor.  Once the rule has run the SQL Table Editor is refreshed so that the action of the rule is shown.  However when the SQL Table Editor on the dashboard is refreshed, the record that had been previously selected/highlighted isn't selected/highlighted anymore (it has lost its focus).  I would like to "automatically" return focus to the previously selected record so that the User doesn't have to click on it again.  It would be "pre-clicked" or "pre-selected".

Member
Jun 21, 2023 4:37 PM UTC

I'm not sure you can do that. However, you can set the parameter value the SQL editor is bound to and achieve similar results. That could lead to other issues if you are not actively clearing the parameter since it'll always remember your selection.

Newcomer
Aug 6, 2023 6:49 PM UTC

Hello,

I have a similar requirement where the Bound Parameter has to return a comma delimited list of the selected row column. The bound column has been defined in the sql table editor. I also have a Supplied Parameter to collect the selected rows and pass it to the bound parameter and then to a BR for further processing. I am not sure how to format the Delimited list. Any help would be appreciated.Picture1.pngPicture2.pngPicture3.png

RobbSalzmann
Employee - Advisor
Employee - Advisor
Aug 6, 2023 10:41 PM UTC

Use  [ square brackets ] around the parameter name that you want a delimited list from:

{DBExtenderName}{FuncName}{CommaDelimitedListOfValues=[|!pm_multipleValuesParam!|]}

Then inside your BR, parse the comma seperated list into an array or list, whatever suits:

Dim arrValues As String() = args.NameValuePairs.XFGetValue("CommaDelimitedListOfValues", String.Empty).Trim().Split(","c)

RobbSalzmann_2-1691362113079.png

RobbSalzmann
Employee - Advisor
Employee - Advisor
Aug 8, 2023 7:57 PM UTC

Try setting your parameter type to "Input Value".  

Newcomer
Aug 8, 2023 10:07 PM UTC

Actually I left it as input but I cleared the parameter bound to the button . It worked and of course we have to use the square brackets to get into an array. Thank You very much for all your help.

RobbSalzmann
Employee - Advisor
Employee - Advisor
Aug 8, 2023 10:11 PM UTC

Ah!  Nice work.  You're right, Input.  I updated the post above to fix that.  I was thinking Input and somehow typed "Literal".  Glad you got it working.