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

EK: Change in SUBSTRING Function Behavior in Extended Auto Properties?

0
Topic starter

Hello, Unitfly Community!

I’ve been using the `<<SUBSTRING>>` function in **Extended Auto Properties** to transform dates from an American format (e.g., `10/23/2024`) into a German format (`23.10.2024`). However, I’ve noticed a behavior change since version **EK 5.2** (and still in **5.4.1**), and I’m curious if anyone else has experienced this or can shed some light on it.

Here’s the logic I initially used, which worked perfectly before version 5.2:

<<SUBSTRING('%PROPERTY_{PD.T.DatumText}%','3','2')>>.<<SUBSTRING('%PROPERTY_{PD.T.DatumText}%','1','2')>>.<<SUBSTRING('%PROPERTY_{PD.T.DatumText}%','6','4')>>

Starting from version 5.2, I had to adjust it as follows:

<<SUBSTRING('%PROPERTY_{PD.T.DatumText}%','3','2')>>.<<SUBSTRING('%PROPERTY_{PD.T.DatumText}%','0','2')>>.<<SUBSTRING('%PROPERTY_{PD.T.DatumText}%','6','4')>>

The Oddity:
- The **first** and **third** parts of the function (`day` and `year`) **remain unchanged**, regardless of the version.
- Only the **second part** (`month`) required a shift from `1` to `0`.

This suggests that there might have been a change in how the function starts "counting" characters. Did the `<<SUBSTRING>>` function shift from a **1-based index** to a **0-based index** for certain parameters?

Has anyone else run into this issue, and do you know if this change was intentional or documented? Any insights would be greatly appreciated!

Cheers,
Daniel

2 Answers
0

Hi Daniel,

i tried to reproduce this issue with EK 5.0.0 and 5.4.2 version and the behavior is the same.

With this config i get the wanted German format in RK 5.0.0. and 5.4.2.

<<SUBSTRING('%PROPERTY_{PD.T.DatumText}%','3','2')>>.<<SUBSTRING('%PROPERTY_{PD.T.DatumText}%','0','2')>>.<<SUBSTRING('%PROPERTY_{PD.T.DatumText}%','6','4')>>

Can it be a problem for some specific case?

I will double check with DEV team was there any changes in EK 5.2 regarding index.

 

Best regards,

Ines

 

0

Hi Daniel,

I double checked with dev team. There were no changes in functions regarding index. Zero based should be used as correct one.

If you think you have some specific case please send us more details so we can try to reproduce.

Best regards,

Ines

Answer

WATCH THE WEBINAR

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