Skip to main content
Nintex Community Menu Bar
Solved

Join Three SmartObjects

  • April 26, 2019
  • 9 replies
  • 94 views

Forum|alt.badge.img+10

Is there a way to join 3 SmartObjects into 1 Method??  I am running into issues once I join my third one.

 

Basically I have the following SMO.

 

EnvironmentTable -  ID / FormID

SafetySMO -  ID / Form ID

FormSMO - FormID / Description

 

I would love to join all of them together into a composite SMO with -

MAIN FORM ID (IDs from Environment / Safety)  / FormDescription  

And show all values from the Environment / Safety.   Like a SQL Join.

 

I can create individual Methods to display  Environment + Form  /   Safety + Form  and they display correctly.

But when I try adding a third it breaks.

 

Or can I display both methods onto 1 view?

Best answer by khanh1

Hi,


 


I would recommend building a SQL stored procedure for this scenario. Multiple joins can have a performance especially if you plan filter a lot of data.


 

9 replies

Forum|alt.badge.img+16
  • Answer
  • April 29, 2019

Hi,


 


I would recommend building a SQL stored procedure for this scenario. Multiple joins can have a performance especially if you plan filter a lot of data.


 


Forum|alt.badge.img+10

Unfortunately, the way the company is using K2 with just SmartObjects on the K2 server - a Stored Procedure isn't an really an option.  Is there any other methods to do this?


Forum|alt.badge.img+15
  • Scholar
  • April 30, 2019

Can you elaborate on what breaks when you try to join the third table? It should be possible to add as many joins as you want to a method of a SmartObject. Screenshots would help us understand the scenario better as well.


Forum|alt.badge.img+10

I can do the joins in two seperate methods and it works perfect.

 

When I do 1 method with all the SMOS and 2 links - it breaks.

 

Basically I have 2 SMOS to hold form data and I need to join it to the Form SMO to give form name.   For filter purposes.

 

See screenshots.  Hopefully that helps.  Only way I've been able to make it work is a right join from the Form to the primary.





Forum|alt.badge.img+15
  • Scholar
  • April 30, 2019

I'm sorry but I would like to know what you mean by it breaks when you add the additional link - does it throw an error? If so, can I please see a screenshot of the error and how your are setting up the links? The details of each row in the "Service Method Links" tab would be most helpful.


Forum|alt.badge.img+10

The columns are blank. 

 

If I have one setup - it works and displays

 

When I set up a method with 1 link - the data appears.

When I setup a method with 2 links - the data does not appear.


Links are:
1st Link:  Form SMO right join to my Environment Table - on the FORMID

2nd Link:  Form SMO right join to my Safety Table - on the FORMID

 

The Blank Column image is how it displays when I setup 2 links (1 for Environment / 1 for Safety)

The Filled in Column image is how it displays when I just have 1 link. (1 for either of the above alone)

 

Attaching images again below.

 

 






Forum|alt.badge.img+10

What I'm utimately trying to accomplish is this:

 

Select
A.column1 as ID,
A.column 2 as FormID,
B.FormDescr, B.FormCategory
from table A join  table B on A.FormID = B.FormID 

union

Select
C.column1 as ID,
C.column 2 as FormID,
B.FormDescr, B.FormCategory
from table C join  table B on A.FormID = B.FormID

I can get this to work in SQL but I can't get it to work using three regular SmartBox SMOs.   With the current business practice here -  I can't create my own SQL Views / Stored Procedures on the K2 Database.   So I'm needing to use Out of the Box functionality if at all possible.

I can get them to individually work but that doesn't help me when I need to have 1 list of everything joined together. 

I've attached screenshots in previous threads that hopefully give an idea.


Forum|alt.badge.img+10

After discussions - I was able to get it to the point where I am allowed to create Stored Procedures on a different database that got me a solution I needed. 


Forum|alt.badge.img+15
  • Scholar
  • May 3, 2019

Ok, great! Sorry I couldn't help you with our other approach, it should've been possible but I couldn't figure out what was going wrong.