How to create a view with object ID

Hello all,

I have question that I've been struggling with for some time. Hope you can help.

We have customers, projects and many other object types imported from our ERP. In M-Files the ID of a project is the project number in our ERP. I can create views with project name as a grouping level easily enough. But in certain cases it would be more convinient to use the project number as a grouping level in a view, which is the ID of the "project" object type. How to achieve this? Need a make new property somehow? Can just make some reference in the view properties?

I'm happy give more info, if somebody is willing to help. Thanks.

  • One way that I think should work is to indeed add a new text property and under Automatic Values you can set it to use the %OBJID% placeholder like below (you can call the property for instance "Project number"). This should fill the external ID into that property automatically.

    If you then add this property to the Project class and use the Recalculate option in M-Files Admin it should fill the property for all the existing projects in the vault.

    Make sure you also check the "Allow this property to be used as a grouping level in views" option on the General tab.

  • Thank you Joonas. This the way I have been actually trying to do this, but so far no results

    This is where I run into problems. As you can see in the first picture I have "Project no" and "J-Number" in the project and it gets the ID. Project no. I have had in M-Files since 2015. The J-number is just a property I made just now for testing.

    In the second picture I can use "Project no" or "J-Number" only as Text when defining grouping level. I cannot find the properties under Project or anything. These properties can only be found when Group by is Text. With this I cannot get any results. Also if I export the values of these properties from M-Files Admin, the txt-file doesnt have any content.

    What I'm doing wrong? I have allowed these properties to be used as a grouping level.

  • What do you want to display in this view? Is it documents? Do those documents have the "Project no" property on their metadata card or only the Project objects?

    If the documents don't have the "Project no" property on their metadata card but are linked to the Project objects, then the grouping level should Project.Project no. You always need to consider what objects you are showing in the view and what metadata they have. If the grouping metadata is on a related object, you need to use an indirect reference like Project.Project no.

  • I want to display documents in class Mechanical Manufacturing Drawing that have Project and Product defined in metadata. This works fine when using Project and Product as grouping levels. Now instead of Project I want to use Project no.

    I'm trying to do exactly what you are describing, but for some reason or another I cannot refer to Project.Project no. Project no can only be found as Text like in the second picture in previus post. Under the Project I cannot find Project no (or the new J-Number for that matter). The lists under Project and Project  (any property) have no mention of either of these properties that should have the project number.

    Here are the settings in M-Files Admin.

  • You need to select Text in Group by since it's a text property and after that you should be able to select the Project no property under Project. I tested this quickly with Customer instead of Project and this worked:

  • Thank you! I got this now working. Not exactly sure what I did wrong in the first place.