Skip to main content

Hi,

 

Anyone able to suggest a way to do this plz?

 

I want to produce a K2 List View that searches in 5 different Smartobjects and then produces a K2 List view based on UserID and whether they appear in each Smartobject, is this possible.

 

I'm thinking the final list would look like this:

 

UserID         SM1             SM2              SM3                SM4                   SM5

 

MrA              Yes                                     Yes

MrB              Yes               Yes                                                                    Yes

MrC                                                          Yes                 Yes                      Yes

 

K2 needs to look at the UserID column in all Smartobjects and add them to this List, then somehow avoid duplicate ID, but ensure the SMx column is YES if exists.

 

Thanks guys, hope its possible

This could be difficult and I have not had a chance to try this but give it a try.

 

For each collumn in the other sytems create a hidden collum for the SMItmeID (just the ID of the record in the other systems or any other piece of information.

 

Assuming the user ID is a value from the list already.

 

In form the intialize rule do a a "for each" rule and call each smartobject with the User ID as input and output the SMItemID or any other piece of information from the found record. If you dont find a record this field will be blank.

 

Now create a change rule on each hidden field that says if it contians a vale then set that SM# to "yes". You might want to default the field to "no" so it says "no" if there is not a rcord found.

 

 

With more thought this might be easier but this is the first thing I came up with, I hope this helps.


hey Micki,

 

Just to add some more info:

 

Each of my 5 Smartobjects have 2 fields (i have more, just lets just say 2) containing USERID and TIMESTAMP

 

So if i can produce a lits which looks at each smartobject, adds the USERID to the new List (if it doesnt already exist in this list) and then puts a tick next to SM1 (for example) to say whether the ID exists and then adds the timestamp to another column.

 

Hope that makes sense


So instead of having a hidden column just call the column the date field and show it and use this as the data you are pulling back from each smart object. If you dont get a record back then the field will remain empty and the rule to change to yes would not fire.

 

Instead of showing a yes
o maybe you could just consider using the data field and if it is blank assume it is "No"

 

Does this answer the question?

 

 


I forgot to address one thing. You can pull back as many columns of data as you want from the smartobejct just use output mapping to add the data.


Hi Micki,

 

Had a quick look at this and don;t quite get it, any chance of a step by step?

 

I was looking at creating a seperate Smartobject and pulling the data into that from the other 5 Smartobjects, but can't get that to work? Your method sounds easiler, but i can't quite understand it. Any chance of a tutorial example on how to do that?

 

Thanks,


Assuming that is based on SQL you can create a view with the UNION statement to make sure only unique values are retrieved:

 

CREATE VIEW SM_User AS (
Select UserID,SM1 as User from USER_TABLE WHERE SM1 is NOT NULL
UNION
Select UserID,SM2 as User from USER_TABLE WHERE SM2 is NOT NULL UNION
Select UserID,SM3 as User from USER_TABLE WHERE SM3 is NOT NULL
UNION
Select UserID,SM4 as User from USER_TABLE WHERE SM4 is NOT NULL
UNION
Select UserID,SM5 as User from USER_TABLE WHERE SM5 is NOT NULL )

 

Once created create a SMO and use within your Control as dropdown or picker. in that case you can filter based on UserID. that should work.

 

Dino.


Caveman, nice avatar!!

 

Can i ask where you are creating this view with? I just use Deisgner

 

Any chance of a small step by step example please?


I am working on trying to do a demo but got side tracked with some real issues. Cavemans example would have to be that all of your smartobjects are SQl tables and that  you have access to buikd views. I assumed at least one or more of them were AD or claims stores. I will make sure what ever I do is in designer. I hope to have somethign today but I cannot gurantee it.

 

 


Thanks Micki for your reply, looking forward to your demo with much anticipation.

 

I'm also looking at other non-K2 ways as well, perhaps dealing directly with the SQL tables, but i would much prefer it to be done with the power of K2 designer.


Reply