Hi,
I have a flow, where someone is filling out a form that is then approved. Once it is approved I need to use the information from this form to enter information into a different form. I have one field where I need to split the information in order to use it in the new form that I am entering information into.
I got help previously for how to make this split and it works. Now I have had to do some changes to the flow (removing an adaptive card for approval and therefore moving this part of the flow to a new flow), but now it keeps failing. When I test it out it keeps giving me this error:
Unable to process template language expressions in action 'Split_first_2' inputs at line '1' and column '23835': 'The template language function 'split' expects two parameters: the string to split as the first parameter, the separator as the second parameter. The function was invoked with '1' parameter(s). Please see https://aka.ms/logicexpressions#split for usage details.'.
Does anybody know why it does that and what I can do?
Thank you!
Best,
Majken
Solved! Go to Solution.
Hi @YDRDK,
Your expression is missing a separator in the split function. Normally this would be something like a comma, semi-colon or whatever character you want to use.
In your case the expression would be something like this. Replace the comma by something you want to use.
trim(first(split(triggerOutputs()?['body/Project_x0020_ID_x0020_Name'], ',')))
Hi @YDRDK,
It looks like it is missing either the string or the separator, because the error says you only have 1.
Can you share a screenshot of your current flow setup and the split expression you are using?
Yes for course.
The expression I am using is this:
Hi @YDRDK,
Your expression is missing a separator in the split function. Normally this would be something like a comma, semi-colon or whatever character you want to use.
In your case the expression would be something like this. Replace the comma by something you want to use.
trim(first(split(triggerOutputs()?['body/Project_x0020_ID_x0020_Name'], ',')))
Thank you @Expiscornovus - that worked! 🙂 I must have missed that part of it and I was going crazy because I could not figure out how.
I have a similar case, where I need to do a split on a user defined input. The problem is that the user sometimes doesn't use the delimiter. I've tried the following code but keep getting an error. Essentially I want to split it if the delimiter is used, but no split if it is not.
if(length(split(triggerOutputs()?['body/subject']))>1,split(triggerOutputs()?['body/subject'],'_')[0],triggerOutputs()?['body/subject'])
Any ideas how to clear it? Thanks!
Hi @MTEChris,
try this:
if(contains(triggerOutputs()?['body/subject'],'_'),split(triggerOutputs()?['body/subject'],'_')[0],triggerOutputs()?['body/subject'])
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
At the monthly call, connect with other leaders and find out how community makes your experience even better.
User | Count |
---|---|
25 | |
24 | |
23 | |
23 | |
19 |
User | Count |
---|---|
58 | |
39 | |
38 | |
29 | |
24 |