HI Everyone,
Can anyone help me out how to substring development type into DEV_TYPE format in outsystems
e.g, Development Type = DEV_TYPE
e.g , Planning Documents = PLA_DOC
Hi Snehal,
Yes, you can achieve it by using the above expression, just make sure you are using Length function in second substr so it'll always give you full value of your last word.
Hi Snehal, Here is how you can do this: I am adding a screenshot of a client action with one input variable of type text and one output variable of type text. This action is completely dynamic so that it will return a correct value no matter how many words the input string has, but if you will only have two words all the time, you only need the sting split server action from the Text extension provided by OutSystems and the substr function of OutSystems with indexing.
1. First If:
2. String Split:
3. First Assign:
4. Second If:
7. For Loop:
8. Assign in the loop:
9. Last assign:
Hi @Snehal Ghegade
You can do it by using SubStr and Index function given by outsystems,
I have created a demo for your case, Refer screenshots for this -
Then in expression -
I hope it'll help you.
Thanks
Deep
Hello
Actually I have multiple values in dropdown list.
like Document type ,Planning Documents ,Model values, Document variable and more.
I want all values in the list in the substr
I hope from the drop down you will store the substring value in entity variable or aggregate to create or update that record in entity.
So before creating or updating records using entity action, use the assignment and use that expression in value to store the substring value in entity
Regards
Murali
Thank you so much for the solution
Hi Snehal
For example assign that value in local variable
And in the expression if you give like that it will work
Hope it will work for your situation
Thanks Murali for helping me in the css
Hi Snehal Ghegade,
I hope you are doing well.
You can also try like this.
Assuming, dropdown list values getting from Aggregate.
Example:
Static/Dynamic entity called DropdownTypes contains all values.
1. Uses Aggregate to fetch records.
2. Use OnAfter fetch property and inside client action use this logic.
3. After using that logic you will get result like this.
For, last string that's up to you whether you have to take 3 or 4 characters, but I think 3 characters are sufficient. Let me know if I can help further.
Best Regards,
Shubham
Hi @Snehal Ghegade,You just need to add calculated attribute to your aggregate like ShortName with the below for formula as shown in below image.ToUpper(Substr(Substr(Documents.Name, 0, Index(Documents.Name," ")), 0, 3)+ "_" +Substr(Substr(Documents.Name, Index(Documents.Name," ")+1, Length(Documents.Name)), 0, 3))
And bind the calculated attribute to Dropdown options Text as shown below:
Oml is also attached for reference.Hope it will help.
Krishnanand Pathak