636
Views
10
Comments
Solved
Outsystem Substring


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

2024-09-12 02-43-38
Deepsagar Dubey
Solution

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.

2024-12-10 04-40-04
Gitansh Anand
Solution

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: 


5. Third If: 


6. Assign in the True branch if third If: 



7. For Loop:


8. Assign in the loop:



9. Last assign:



2024-09-12 02-43-38
Deepsagar Dubey

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

UserImage.jpg
Snehal Ghegade

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

2024-09-12 02-43-38
Deepsagar Dubey
Solution

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.

2024-05-02 09-49-04
Murali Manoharan V
Champion

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

UserImage.jpg
Snehal Ghegade
2024-05-02 09-49-04
Murali Manoharan V
Champion

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

Regards

Murali


UserImage.jpg
Snehal Ghegade

Thanks Murali for helping me in the css 

2024-12-10 04-40-04
Gitansh Anand
Solution

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: 


5. Third If: 


6. Assign in the True branch if third If: 



7. For Loop:


8. Assign in the loop:



9. Last assign:



2021-08-12 05-19-40
Shubham Janbandhu

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

2023-04-16 15-25-31
Krishnanand Pathak

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.

Regards

Krishnanand Pathak

SortName.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.