I think this should help:
Length(Task.LoanAmount) > 3 ? Left(Task.LoanAmount,3) + "%20" + Substring(Task.LoanAmount,3,3) : Task.LoanAmountWhere the above expression is an expression in an Update Data block.
For my example expression above, the variable that is holding the value is Task.LoanAmount. So you could substitute your variable name in for Task.LoanAmount.
The first part of the expression tests the length to see if we need to insert "%20". If the length is greater than 3, for example "1234" or "123456", then we take the first three characters of the string, add "%20", and then add the remaining part of the string up to 3 additional characters.
So, "1234" would turn into "123%204".
If the length is not greater than 3, then we leave the value as-is. For example, "123" -> "123".
If, in the future, you decide to change the allowed max length of the string to a value greater than 6, you will need to change the expression.
------------------------------
Dan Fontaine
ConvergeOne, Inc.
------------------------------
Original Message:
Sent: 02-10-2021 10:53
From: Mostafa Oudderhem
Subject: How can I add a character in the middle of a string variable ?
Hi Dan,
It should always be after the third digit when starting from the right to left (only for numbers with more than 3 digits length).
Also, it is not necessary to add this character if numbers are less that 3 digits length (example 7, 27, 103...etc.)
Thank you.
------------------------------
Mostafa Oudderhem
Coverage-Communication
Original Message:
Sent: 02-10-2021 10:45
From: Dan Fontaine
Subject: How can I add a character in the middle of a string variable ?
Okay, so do you want the %20 to be to the left or right of the middle for values with an odd number digets? For example,
1%2023 or 12%203
12%20345 or 123%2045
------------------------------
Dan Fontaine
ConvergeOne, Inc.
Original Message:
Sent: 02-10-2021 10:40
From: Mostafa Oudderhem
Subject: How can I add a character in the middle of a string variable ?
Hi Dan,
Thanks for your reply. It will be just numeric (exemple: 123456) entered by the callers.
But the length can be at least 3 digits and max 6 digits.
Thank you.
------------------------------
Mostafa Oudderhem
Coverage-Communication
Original Message:
Sent: 02-10-2021 10:35
From: Dan Fontaine
Subject: How can I add a character in the middle of a string variable ?
Will the value in the variable always be 6 alphanumeric characters in length?
------------------------------
Dan Fontaine
ConvergeOne, Inc.
Original Message:
Sent: 02-10-2021 04:57
From: Mostafa Oudderhem
Subject: How can I add a character in the middle of a string variable ?
Hi,
In Architect, I want to add character (exemple %20) in the middle of a string variable created in Architect.
I don't know which expression I have to use.
For example, the variable value is : "123456" (entered by the caller), I want to change it through Architect expressions by adding "%20" in the middle of that variable to be "123%20456".
Any help please ?
Thank you in advance.
#Implementation
#Integrations
#PlatformAdministration