Skip to main content

Dear Experts,

 

Is it Possible (is there a way) we add new column in a list view in smartform that associate with the other column smartobject in it.

 

Acctually i have problem make a group by some column in a smart object and i want to get Count from that group by.

I want to do it from a smartform (not in the smartobject).

 

For Example i have a list of a smartobject :

 

Column ID    ColumnName   ColumnType  ColumnPrice

1                    X                        A                      $100

2                    Y                         B                      $200

3                    Z                         B                      $300           

 

 

from the smartobject i want to create my own list view in smartform become :

ColumnType   CountOfType

A                      1

B                       2

 

I want add new column CountOfType that contain the count and group by ColumnType  of the smartobject above.

the CountOfTypewe make it mannualy in the k2 designer New View

 

Is it Possible using k2designer or k2studio ?

 

Please let me know

 

Thanks,

 

Musa

well if i understand you, you will need a 2nd sharepoint list, for 


ColumnType   CountOfType


A                      1


B                       2


 


ColumnType would be a look up field looking from columnTyple. Then just create a new Smart Object for the new list. 


Dear Sir,

 

Thanks for reply,

 

Can we do without making new smartobject?,

Beside i'm not using sharepoint.

 

it's a simple question.

 

Can we do it (add the count of type) with the existing/original smartobject and customizing it in k2 designer by make new view and using workflow or anything else to show the count of type ??

 

Thanks you,

 

Musa


well you would need to update/recreate your SMO after you change it then it should work with all your flows and views. To update/recreate you do the follow;


 


>> Open the smartobject tester


>> Find the correct service service


>> Righ click refresh service instance


>> Create new smartobject


>> Change name of new smartobject to the same as the old smartobject


>> Click get exisitng GUID


>> Change catagory to catagory as the old smartobject


>> it will warn you replace exisitng smartobject hit yes.


Dear Kevin,

 

So that means the only way that we can do is update/recreate the smartobject right?.

 

So in K2 there is no other way to manipulate adding column in a view from a smartobject besides update/recreate the smartobject it self right?.

 

Thanks,

 

Musa


As far as I know, yes


Musa,

 

You can mannually create a new column and add a data lable to it and produce information on the fly.

 

I believe your solution can be done with a data label, however I have not been able to produce the correct formula that would be required to get that info.

 

It would look something like the image:

15551iED6F67BA98EE6E14.png

 

Where you would just drop a Data label on a blank column and apply an expression against it.  Generally what I do is look up excel formulas that match the data I'm trying to generate and re-tool them to work with a K2 expression.  

 

I'm not quite convinced this is the correct option for this scenario, however I wanted to open you up to this possibility.

 

**My original tests kept coming back with a 1 in the CountType field, however I have an idea on this one...give me a couple of hours I might be able to come up with an answer.**


I was able to manipulate the view parameter (trying to get the value into the datalabel), but it only displays the last number I adjusted it to (i.e. column full of 2's, 3's...).  I would guess that the best way is to modify the smart object via the "Configure Association" piece by editing it.  However the association data is never exposed when you add it to a rule (at least not for me).

 

 11582iDACB194F83F04912.png

 

I would like to see this one conquered...I've tried to use this before in a ranking type scenario where you let the user rank data from highest to lowest, however I modified the column data where they would manually put in the number.


Dear David Aerne,

 

Thank you for help me out for doing research about this issue,

 

I try your last reply about configure association at the smartobject,

 

and i try to add new column at my view list, so that i can add the associate smart object at the new column,

 

is this that you mean right?.

 

But unfortunately :

 

1. when adding the control at the new column at the new view, data label can't provide the associate smart object (because the properties have no datasorce to configure), in order that, i only know using drop down list and set the datasource.

 

2. thanks again for your help, but configure association still not resolve what i need about manipulate the new column as we want by doing expression that we want.

 

So the things that i only can do is adding the column by recreate/update the smartobject inside.

 

Thanks,

 

Musa


Dear David Aerne,

 

i change my mind 😃.

 

just check about your first reply here.

 

Thanks again about the datalabel solution 🙂.

 

it helps me, but i check all over expression, i only found list Count there, but when i use that expression and add the context smart object column that i want, it only return 0 (zero).

 

But thanks for your help, so that i know how to add new custom column using expression.

 

for the grouping countoftype i believe it is only can be done by recreate the smartobject.

 

Thanks,

Musa


There are two pieces that we would have to look at here.  I think this can be done, however the complication level is high.

 

SmartOjbect: when you create a new type, it would have to be checked for uniqueness when created.  If it is a unique type, then mark its count as one.  If one or more has been created, then check the count and increment it by one.

 

Data Label: I think this is also a possibility.  However, in this situation I think a view parameter is needed and those don't play well with lists.

 

I'm going to try the smart ojbect piece again today when I get a chance.  I think there might be something in testing to see if the name (or type) has been submitted, along with creating a new value in the same smart ojbect of count.


Reply