Hello,
I am building service template and in that I want to filter the table using foreign key of that table. How I can use that directly in service template?
I have already saved foreign key in automation script so I have to filter an entire table based on foreign key.
Please share your thoughts on this.
Thanks.
Hi Aditiben,
Interesting case you have there. We would need to approach this a bit different I believe but you are indeed on the right track when thinking about creating the right filter for your table parameters, as this is what you need to define when selecting the table parameters you want to include in your service.
When filtering you can choose to apply this filter on 2 columns of your table. One column being the primary key column and the other one being your display key column. By default the filter is always applied directly on the display key column. This column typically has "[idx]" appended in the column name.
In case you need to apply the filter on the primary key column instead, you can start your filter with ^pk^ . This will indicate to the software that you want to apply the filter on the primary key instead of the display key.
On top of that, we also have a capability that allows you to retrieve a value from a parameter of an element and use this value in your filter. What you then create can be described best as a nested filter. Here's an example of such a nested filter:
* ([element:1:param:4151:*/ [data:outputmcrödelheim]:5000 *]) /*
What this filter does is look at the included service element with id 1 and take the value from parameter with id 4151. In this case this is a table parameter so an extra filter */ [data:outputmcrödelheim]:5000 * is also configured to indicate the row to take this value from. The * character can always be applied as a wildcard mask. [data:outputmcrödelheim] is referring to a value that is coming from the input data we configured on the service template.
When this is being resolved by the software it will look at the input data variable named "outputmcrödelheim" and use this in the filter defined for the parameter placeholder --> for example [element:1:param:4151:*/ 232.102.51.2:5000 *] this will allow the system to retrieve the value of column parameter with id 4151 that matches the filter */ 232.102.51.2:5000 *. This value being 10.241.65.18
This results into the following filter * (10.251.65.18) /* that will be eventually applied on the parameter you are filtering on in your template.
You can configure these kind of nested filters directly in the editor where you select your parameters which you want to include in your service:
It's through building these kinds of nested filters that you will need to try and compose the right filtered dataset for table parameters on included service elements.
Making sure that your table display key contains the right set of information is always key in systems where a service layer is being deployed. As this can clearly simplify or complicate the filter definitions required when configuring your services.
So you your case, take a look at the display key and primary key of the tables you want to include in your service. Then see if you can somehow (via static input or via input data or via dynamic parameter retrieval) get value that will filter out the correct row.
Hope this could help you out a bit further! If you get stuck somewhere, definitely feel free to reach out again!