1
votes

Good morning. I am new to logic apps and I'm wanting to add an optional parameter to the logic app shown below. I assume that if I specify it in the relative path it will always need to be provided, but maybe that's not the case. It's a boolean parameter, so perhaps there's a way to set a default of "false" if it's not provided? Any suggestions would be greatly appreciated!

enter image description here

1

1 Answers

0
votes

You need to set dynamic content and expression to achieve this:

enter image description here

if(equals(triggerOutputs()['relativePathParameters']['type'],'{}'),false,triggerOutputs()['relativePathParameters']['type'])

if(equals(triggerOutputs()['relativePathParameters']['year'],'{}'),false,triggerOutputs()['relativePathParameters']['year'])

And this is the official doc of the expression:

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#if

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#equals