smart object returning multiple records when a parameter value is passed

  • 13 October 2020
  • 8 replies
  • 92 views

Hi Team,

My smart object tester tool is returning wrong data when executed with a value. I have a property "ProcessID" when i enter value 6 and execute it, its giving all rows starting with 6, instead of rows with value equal to 6. Can you please let me know,  right way to give value here.

Thanks,
Pradeep
 


8 replies

Badge +11

Hi @pnelli would it be possible for you to provide exact SmartObject type? I.e. based of which Service Type / external system it is based? Is it SharePoint, SQL or something else that acts as a data source for it. Easy way to confirm parent service instance in Tester Tool is to click on SmO name + icon, then expand methods, then expand/click on + for some specific method - you will see parent service instance.

It would also help if you will show screenshot of SmO input parameters you are using in tester tool.

I would agree with the previous reply. 
The data source of the SmartObject is probably important. 

Also, is the "ProcessID" the Primary Key of the SmartObject? When searching for the PrimaryKey compared to other columns it might behave differently when adding Input Properties. 

Also what is your K2 version and K2 Updates patch level? 

There are a lot of things to check here, best way might be to log a K2 Support ticket to look at this further. You can do this from our K2 Portal site (https://portal.k2.com/).

Hi Mikhail,

Sharepoint list is the datasource for my smart object. My sharepoint list has some properties defined and its the data source for my smart object. When i execute GetListItems by passing a parameter value, its returning all the records which start with that value. Please find the screenshot.

 

Thanks,

Pradeep

 

Badge +11

By all sign SmO does contains or starts with filter bringing all that matches “Procurement Inventory*” for BusinessProcess and “10*” for Business process ID, although that marked as Number and should not be threated as a text. Maybe try using Filter and construct more specific/explicit filter to pool the data you want? There is a Filter button in Tester Tool which brings up GUI to construct filtering expression.

Hi Mikhail,

I haven’t used any *(asterik), so it should be fetching me the records which are equal to the value for both text and number types. I have tried the filter option and its fetching me the expected output, but how do i apply filters in my workflow?

 

Thanks,

Pradeep

Badge +11

Pradeep, I can do some checks on my end if you confirm to me your exact K2 version, SharePoint version and SharePoint Service Broker you are used (there is more than one). It may also play a role what kind of data type your columns have on SharePoint side and list template used.

I also believe that there should be a way to use filters when calling SmO within workflow.

I’ve just did a quick test with K2 5.3 and SharePoint 2013 broker list based SmO and I don’t see behavior you are reporting - it only does wildcard search if I explicitly add star sign:

Data source has more than one item with word Procurement in its title but only one ID 10 (101, 102 also present)

So I guess it maybe version specific, please clarify your K2 version.

Hi Mikhail,

K2 version is 5.2 and sharepoint is 2013. I have text type data type in sharepoint.

Would you be able to try the same in K2 5.2 version?

Thanks,

Pradeep

 

Hi Mikhail,

Can you please give me any URLs or guide, me to filter the SMO in K2 workflow. I am using K2 studio and i don't find any option there. I have also tried giving parameter value as eq ‘6’

 

Thanks,

Pradeep

Reply