Community

Connect with us and enhance your M-Files experience using Unitfly Toolkit for M-Files. Here’s how to get started.

Notifications
Clear all

[Solved] EK: Excel Writer

0
Topic starter

Hey Folks

Im trying to put a a property on an excel spreadsheet and its not working.

First:

What is expected for "Wildcard"?

What is "action mode"?

image

 

image

The configuration looks pretty solid, still its not doing anything, also no entries in the debug log.

 

Any ideas?

regards

Daniel

10 Answers
1

Hi Daniel,

issue with automatic state transition in combination with Excel writer is a known issue and it is escalated to the dev team.

It is under review, we will inform you about this case as soon as we have any new info from the dev team.

Best regards,

Ines 

0

Hi @daniel-mislovic,

 

wildcard is used to select specific file from MF object.

For general use, I would recommend using *.xlsx. Please try with the recommended wildcard. 
If you have multiple Excel files with wildcard you can specify which one to search. Example: *_test.xlsx

Also, please double-check if the sheet name is correct (CRA 3.0). It is very important to have it correctly, without an exact sheet name rule won't work.

Other than that, the configuration looks fine.

 

Action mode has two options: Cell and Copy Content.

The Cell is used to insert properties into the cell, like in this case.

With Copy Content is possible to copy a range or sheet between Excel files.

 

Please let us know if these hints helped.

 

Best regards,

Ines

0
Topic starter

Hi Ines
After intense testing, we found the problem. First: The rule works fine, as long as we use it manually, means: We have an m-files WF where Step 1 is writing data into Excel, step 2 is convert to PDF (MF state build in function).

Excel Writer EK Trigger is WF State.

As long, as we do it “manually” it works. As soon, as we set the WF State to change automatically (within 0 days auto-next wf step) it doesn't work. Using EK 5.0.

Cheers

Daniel

0

Hi Daniel,

 

please can you attach a configuration for excel and describe exact steps for this case when automatic state transition is trigger (workflow)?

We are testing this issue and we would like to reproduce exact case  since for some scenario works, and for some not.

 

Best regards,

Ines

Daniel Mislovic Daniel Mislovic Topic starter 22/03/2024 12:43 pm
Daniel Mislovic Daniel Mislovic Topic starter 22/03/2024 12:44 pm

@ines 

{
    "Enabled": true,
    "RuleGroups": [
        {
            "Name": "OT Dokument",
            "Rules": [
                {
                    "Name": "OT Dokument: CL SPG / CRA 3.0 Vorlage",
                    "Description": "Immer vor dem konvertieren zu einem PDF soll der Wert in die Vorlange eingefügt werden.",
                    "Trigger": "ObjectEnteredState",
                    "Source": {
                        "ObjType": "{53F0C8FD-0BF0-47C4-8FA6-4C2D0DADB650}",
                        "Class": "class.SPG",
                        "Workflow": "WF.PdfKonvertierung",
                        "State": "state.PdfKonvertierung.Admin",
                       "SearchConditionFilters": [
                            {
                                "SearchConditions": [
                                    {
                                        "conditionType": "equal",
                                        "expression": {
                                            "type": "propertyValue",
                                            "propertyDef": "prop.Gegenstand",
                                            "indirectionLevels": []
                                        },
                                        "typedValue": {
                                            "dataType": "lookup",
                                            "value": {
                                                "lookup": {
                                                    "item": {
                                                        "id": "{814C0431-7675-41AF-AA72-75A604E159CA}"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                ]
                            }
                        ]
                    },
                    "FilenameWildcards": [
                        "*"
                    ],
                    "FileActions": [
                        {
                            "Name": "Schreibe die Beschreibung in die Zelle",
                            "Action": "Cell",
                            "MapMode": "SourceObject",
                            "Cell": {
                                "Cells": [
                                    {
                                       "CellActionType": "Cell",
                                        "Sheet": "CRA 3.0",
                                        "SetValueByAlias": false,
                                        "Column": "A",
                                        "Row": 29,
                                        "CellValue": "%PROPERTY_{DPD.MS.CustomerRiskAssessments}.PROPERTY_{PD.ML.AnmerkungenRisiko}%"
                                    }
                                ]
                            },
                            "Enabled": true,
                            "TargetFilenameWildcards": [
                                "*"
                            ],
                            "CopyContent": {
                                "CopyContents": []
                            }
                        }
                    ],
                    "ConfigurationMode": "Advanced"
                }
            ]
        }
    ]
}
0

Hi Daniel,

 

thank you for the details. I will get back to you as soon as we review this specific case.

 

Best regards,

Ines

0

Hi Daniel,

I assume your Excel Writer rule should execute in the state 'Obernahme kommentar in XLSX' since there is no 'Admin' state shown in your workflow screenshot?
If that is the case, then the problem lies in automatic state transitions and the conversion to PDF. The Excel Writer rule is executed in the background, and when an object enters the specified state, the rule is triggered and added to the task queue. However, the state transitions and conversion to PDF occur too quickly. By the time the task processing starts, the object is already in the final state, and the file is converted to PDF and this is the reason why rule execution fails.

Only current option to avoid this issue is to remove the automatic transition to a state where the file is converted to PDF. Additionally, I have opened a ew work item to add a static property setter. This will allow you to have a 'flag' property on your source object, which will be populated when the rule is executed. You can then use this property as a trigger for automatic state transitions.
The work item related to this has ID 1268, you can track its progress in the release notes of upcoming Extension Kit releases.

 

Regards,
Tadej

0
Topic starter

Hi Tadej

Posted by: @tadej-setinc

I assume your Excel Writer rule should execute in the state 'Obernahme kommentar in XLSX' since there is no 'Admin' state shown in your workflow screenshot?

You are right. Would it work, if we used the orchestrator and something like monitored Property for “version” and try to find out, when is possible or trying to do it in event handler mode?

Just thinking broad...

Cheers

Daniel

0

Hi Daniel,

 

At the moment, Excel writer doesn't have option to be orchestrated, but this feature will be added soon.

When this feature is added, you can try monitoring the version, but I'm not convinced it's the best approach to achieve what you want. I still believe that the option I mentioned in my previous answer may not be the best, but it is certainly more reliable. And I just realized now, that even better would be to simply set the State property instead of using a 'flag' property - This way you would be able to execute writer rule and move the object to next state at once, and keep your workflow automated without automatic state transition in this state.

 

Event handler option won't work, because file based modules are being executed only in the background.

 

Regards,

Tadej

0
Topic starter

Posted by: @tadej-setinc

to simply set the State property instead of using a 'flag' property

That is an excellent idea! This feature of "set a property after the rule was successfull run" should be in almost every module. I was often implementing stuff around this missing feature in general.

+1 from IMCT

Cheers

Daniel

0
Topic starter

FYI: I tried to auto transfer WF state when versionname is empty because the Excel Writes empties the value when it’s finished. But M-Files is not playing by the rules and ignores changes on this property:

image
image

 

Sometimes M-Files is weird.

Cheers

Daniel

Answer

WATCH THE WEBINAR

Introducing AI Document Kit: Add-on for AI-driven Document Management