Hi Everyone,
I got two simple questions while creating the Flow:
A. I would like to get the integer number from the string, ex:
Input AB1738
Output 1738
I know use skip expression can do it, like this @{skip('AB1738', 2)}, but the design of input is variation by different times, some time input will become A1738, so skip is not suitable for my case, any idea can share?
B. The other issue about the duplicate data, I want to duplicate the data for 3 times, ex:
Input: 2019-11-16T01:12:22.5967458Z
Output: 2019-11-16T01:12:22.5967458Z, 2019-11-16T01:12:22.5967458Z, 2019-11-16T01:12:22.5967458Z
Is it possible?
Please help on these, thank you.
Regards,
ilu989
Solved! Go to Solution.
If anyone has an easier way to do this then I'm all ears but this is what I've got for you:
I started by entering your test string and then calculating it's length
length(outputs('String'))
Then add the following 3 variables:
Then add the following 'do-until' of 'counter = outputs('Length')'
substring(outputs('String'),variables('Counter'),1)
Here's the inner condition:
contains(variables('Numbers'),outputs('SubString'))
outputs('SubString')
After the 'do until' run an 'apply to each' on the 'Numbers Result Array' and append each number to the 'Final Results String' variable. Then I just used the last compose to display the result:
If you find an easier way of doing this then please let me know but I can't think of one at the moment.
For your second question of duplication, you can just add the same variable/dynamic content 3 times.
If I have answered your question then please consider marking this post as a solution and a thumbs up!
Sam
While your question is simple, the answer is not....
Below is another solution to your issue breaking apart the string and capturing only the integers. I loop through each element of the string and try to convert it to an integer. If it fails, I just move on to the next element. This is facilitated by the run after setting. The final compose action is just so that you can see the result.
In answer to your second question regarding the dates/times, you can use the concat() expression - see my example below:
If anyone has an easier way to do this then I'm all ears but this is what I've got for you:
I started by entering your test string and then calculating it's length
length(outputs('String'))
Then add the following 3 variables:
Then add the following 'do-until' of 'counter = outputs('Length')'
substring(outputs('String'),variables('Counter'),1)
Here's the inner condition:
contains(variables('Numbers'),outputs('SubString'))
outputs('SubString')
After the 'do until' run an 'apply to each' on the 'Numbers Result Array' and append each number to the 'Final Results String' variable. Then I just used the last compose to display the result:
If you find an easier way of doing this then please let me know but I can't think of one at the moment.
For your second question of duplication, you can just add the same variable/dynamic content 3 times.
If I have answered your question then please consider marking this post as a solution and a thumbs up!
Sam
While your question is simple, the answer is not....
Below is another solution to your issue breaking apart the string and capturing only the integers. I loop through each element of the string and try to convert it to an integer. If it fails, I just move on to the next element. This is facilitated by the run after setting. The final compose action is just so that you can see the result.
In answer to your second question regarding the dates/times, you can use the concat() expression - see my example below:
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
User | Count |
---|---|
5 | |
3 | |
2 | |
2 | |
2 |