cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ras1000
Helper I
Helper I

Getting "Definition contains invalid parameters"

I am working to enhance my skills Microsoft Flows and am starting to use Workflow Definition Language (WDL) expressions.

 

I have created a flow sets up a variable containing the first names of the father or mother or both.  The first names are extracted  from Microsaft form response fields containing combined first and last names.  It is possible that these fields could be empty, have one parent, or have both.

 

I created a variable called FirstNameString that I would like to use in a salutation in a customized email further down in the flow.  Unfortunately, I am getting a "Definition contains invalid parameters", when I try to save the flow after inserting the variable.

 

The expression is: 

if(and(empty(variables('FatherFirstLast')),empty(variables('MotherFirstLast'))),'',if(and(not(empty(variables('FatherFirstLast'))),empty(variables('MotherFirstLast'))),substring(variables('FatherFirstLast'),0,indexOf(variables('FatherFirstLast'),' ')),if(and(empty(variables('FatherFirstLast')),not(empty(variables('MotherFirstLast')))),substring(variables('MotherFirstLast'),0,indexOf(variables('MotherFirstLast'),' ')),concat(substring(variables('FatherFirstLast'),0,indexOf(variables('FatherFirstLast'),' ')),' and ',substring(variables('MotherFirstLast'),0,indexOf(variables('MotherFirstLast'),' '))))))

I should point out that the logic identifies the index of the space between the first and last name, which is then used as the length in the substring for the first name.

 

Appreciate help from anyone.

1 ACCEPTED SOLUTION

Accepted Solutions

Sorry, it seems to work after clsoing and restarting my flow.

View solution in original post

3 REPLIES 3
ras1000
Helper I
Helper I

After doing a little more troubleshootng the problem seems to be occurring indexOf portion of the code, namely the string to be searched.  In my case the string to be search was a string variable that I had created.

ras1000
Helper I
Helper I

I apologize.  I restarted my flow and I no longer encounter the problem.

Sorry, it seems to work after clsoing and restarting my flow.

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (1,531)