In a Condition I reference a manual trigger field (subject/body) using this expression:
lastIndexOf(triggerOutputs()?['bodysubject'],'-') IS EQUAL TO IndexOf(triggerOutputs()?['bodysubject'],'-')
I get this error:
Unable to process template language expressions for action 'Check_If_Old_Subject_Format' at line '1' and column '25728': 'The template language function 'lastIndexOf' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#lastindexof for usage details.'.
Why? The trigger 'bodysubject' is a text. Is that different a 'string"? 'String' isn't an option in the manual trigger step.
Thanks very much.
Details in trigger:
Solved! Go to Solution.
Wonderful! Solved!
And your help @v-bofeng-msft has gotten me past something else as well.
My main issue was that I should have selected "Drop-down list of options" in the manual trigger. I only needed one result.
With only one result my original expressions work!
IndexOf(triggerOutputs()?['bodysubject'],'-')
IndexOf(triggerOutputs()?['bodysubject'],'-')
If I remove the [0] from your expressions (because it's no longer a set) it also works!
lastIndexOf(triggerBody()['text'],'-')
IndexOf(triggerBody()['text'],'-')
PS -
The answer to your question: I was temporarily using the "Manual Trigger" because the Outlook "Get an email" trigger was not working and I needed to move on and test other parts of my flow. Now that you've helped me I can go back and tackle that issue.
Thanks very much!
Hi @Paul_Iowa :
Could you tell me:
I assume the user selects only one value.
Firstly,let me explain why you encountered this problem.
The point is the value of triggerOutputs()?['bodysubject'] is an array.Because you set multiple selections in the trigger, its return value is an array.The first parameter of the lastIndexOf and IndexOf functions must be a string, so your flow will report an error.
Secondly,I suggest you use [0] to extract the value of the first item in the array to solve this problem.For example
Best Regards,
Bof
Wonderful! Solved!
And your help @v-bofeng-msft has gotten me past something else as well.
My main issue was that I should have selected "Drop-down list of options" in the manual trigger. I only needed one result.
With only one result my original expressions work!
IndexOf(triggerOutputs()?['bodysubject'],'-')
IndexOf(triggerOutputs()?['bodysubject'],'-')
If I remove the [0] from your expressions (because it's no longer a set) it also works!
lastIndexOf(triggerBody()['text'],'-')
IndexOf(triggerBody()['text'],'-')
PS -
The answer to your question: I was temporarily using the "Manual Trigger" because the Outlook "Get an email" trigger was not working and I needed to move on and test other parts of my flow. Now that you've helped me I can go back and tackle that issue.
Thanks very much!
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 |
---|---|
14 | |
5 | |
4 | |
4 | |
4 |
User | Count |
---|---|
13 | |
6 | |
6 | |
6 | |
5 |