squaladesign
Forms Fledgling

How to change data in the list view

Hi everyone,

I'm created a Smart Form with many List view not editable and when an item is clicked on the right it will appear the Edit Item view.

Screenshot 2021-06-21 095950.png

 

The question is, how can I change the data in the List view? In the example the H3 (in yellow) is actually called "Fair condition". I managed to change into the Item view but I don't know how to "translate" in the List view. Another example is that all 1 = Yes and 0 = No but I like to show Yes and No and not 0 and 1.

Is that possible in the List View?

Thanks

Labels: (1)
0 Kudos
Reply
12 Replies
Prineel_V2
Forms Fledgling

Re: How to change data in the list view

Hi,

For the first part, if you have updated it in the itemview, then it should be updated in the database therefore if you refresh the list view, it should also be updated. If it hasnt been updated in the listview then perhaps check the database and see if it has been updated. 

For the second part, i know that some controls save the value as 1 or 0 (like the checkbox), so if you arent calling it back into a checkbox control, i think it would just call the number. I doubt there is any way of displaying it as another value. You can create another coloumn in your database and save "Yes" or "No" depending on what the number is, then just have that as the display value in your listview as a workaround, but im not sure if that will work on form level (when you save/create to the database) or if you will need a stored procedure. 
Not sure if i made much sense lol, just let me know if you need clarification on anything.

0 Kudos
Reply
squaladesign
Forms Fledgling

Re: How to change data in the list view

Hi @Prineel_V2 

in the Item view I changed my drop-down with a "translation", example, in the database I have H1, H3 and H5 for the list of condition, but in the item view when a user will change or see the drop-down will see Fail, Fair, Good in the condition field. 

squaladesign_0-1624334422385.png

 

I like to do exactly the same in the table view...I tried but it's not working on the same way.

squaladesign_1-1624334501609.png

 

squaladesign_2-1624334526070.png

 

Is that possible?

 

P.S. I cannot change the structure of the database because come from ArchGIS.

0 Kudos
Reply
P_M
Canvas Initiate

Re: How to change data in the list view

Hi,

You can try with expression.If the column value is coming as H5 then assign Good as value.

If condition in Expression.

I think this would help.

0 Kudos
Reply
squaladesign
Forms Fledgling

Re: How to change data in the list view

I tried the expression and it replace all with the same data 😞

0 Kudos
Reply
Prineel_V2
Forms Fledgling

Re: How to change data in the list view

Hi,

Your list view will only show the value stored in the database (H1, H3 and H5). Can you not rename or edit those values to the display names? Or does the database you use not allow for save/update methods?. Perhaps it's possible to change those values in the database itself? 

0 Kudos
Reply
squaladesign
Forms Fledgling

Re: How to change data in the list view

I cannot change the database, so, the H1 must remain H1, what I like to do it's just "presented" the data with different names. Sometimes I have 0 that is No and 1 that is Yes, so i like to show Yes but I cannot change the information in the database to be Yes instead to 1.

The database come from GIS I cannot change it or it will not work ArchGIS.

The database allows update but the format must remain the same.

0 Kudos
Reply
Prineel_V2
Forms Fledgling

Re: How to change data in the list view

Im not sure if its possible to change it in the listview. From my understanding of K2, this is not possible at all, maybe someone has a solution or work-around. Hopefully there is one.

 

Kind Regards

Prineel

0 Kudos
Reply
VasanNaick
Design Dabbler

Re: How to change data in the list view

Hello @squaladesign 

 

I am going to show you how I solved this issue using MS SQL as my database and K2. You should be able to adapt some parts to your solution.

 

With any database you have relations (Primary keys and Foreign Keys), so you will have to stipulate that in K2 as to how the DB is linked to one another. In order to do that you will use Associations.

 

Let me show you how I achieved with an example:

 

1. The following is my Database Diagram

 

Vasan_0-1624547025496.png

As you can see, the condition table contains the following values:

 

Vasan_1-1624547096812.png

And Pole Inspection contains the following values:

Vasan_2-1624547162892.png

The reason for the ConditionID (int) in the above table is because it links the type of condition. In your case it is the H1, H2.... These values are the primary keys and wouldn't change, so you just would have to update the records in the Data.Conditions table and it will change the values in all tables.

 

2. When you create your smart objects, you will need to do the following:

 

Firstly you will need to add an association (it basically means which table is connected to which and by what values are they  linked)

 

Vasan_3-1624547488838.png

 

Add your association

 

Vasan_4-1624547550530.png

 

Next, indicate which values are linked to one another

 

Vasan_5-1624547608125.png

 

Next, when designing your view, configure it as below:

 

Vasan_6-1624547667584.png

The above image indicates that the values in the condition row are linked to another smartobject by a specific ID (ConditionID) and we want to display the certain field (ConditionType) instead of the ID. 

 

Finally when you run your Form, it will link the ID property to the Condition Type and Displays as follows:

 

Vasan_7-1624547811473.png

I hope this helps you and if it did, please mark as complete.

 

Kind Regards

 

0 Kudos
Reply
P_M
Canvas Initiate

Re: How to change data in the list view

Hi,

I have one smo having id and level

id    level

1      Low 1

2      Med 1

3      High 1

now i created list view using this smo and on value field I have added expression. So whenever in your list view column has value Low 1 it will disply as Low and all other values as Medium.

P_M_0-1624622098520.png

 

P_M_1-1624622159024.png

Remember when we use column from smo ,the field in body section of column contains the db field. If we use same column in expression ,it will give round error. So remove that and add expression.

Below is the output. 

P_M_2-1624622688334.png

Try by this way..Hope to be helpful

 

0 Kudos
Reply