Hello community,
I am trying to map the following use case in an automation, unfortunately without success: I want to "increment" the current value of the Angenummer attribute in asset management, in the first step I try to divide the string Angenummer (2024/1), unfortunately that doesn't work for me (I don't get a result): I have already tried the following functions:
{{lookupObjects.first.Angenummer}} = Angenummer is displayed {{lookupObjects.first.Angenummer.split("/").1.asNumber}} = No result {{lookupObjects.first.Angenummer.split("/").1}} = No result {{lookupObjects.first.Angenummer.split("/")}} = No result Test {{lookupObjects.first.Angenummer.trim().split("/").1}} = No result Result
I've already tried substring - unfortunately without result.... Does anyone have an idea why this doesn't work?
You state you have tried several things, yet the community cannot observe those to compare what you believe happened to what the rule execution shows...
For a question like this, context is important for the community to help. Please post the following:
Kind regards,
Bill
Hi @Negjat Jusaj ,
".1" is not a valid getter for the list type in smart values. You can use following to access the elements:
So, just change your smart values as {{lookupObjects.first.Angenummer.split("/").get(1)}} in order to get "1" from "2024/1"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
thanks for your contribution, unfortunately I still don't get any results
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, then new idea:
And then, can you share the logs if this doesn't work?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Salih,
thanks for your help. I'm already running the logging, the problem is that I'm not getting any errors with the smart values used, but simply no results are being output.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As I remember split() is working on strings. I'm not sure that your script knows that you are working on string.
Please try to add toString() before split()
Also what is see is you are using LookupObjects which is array so definatelly your split() is trying to work on array, not string.
Regards,
Seba
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Sebastian Krzewiński , the value is "2024/1", so it is probably a string at first place :) I think this is related with ".1" at the end.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.