Solved

Error Publishing Workflow

  • 19 December 2017
  • 17 replies
  • 204 views

Badge +5

Hi,

 

I am getting the following error message when I try to save/publish the workflow:

 

"Error publishing workflow. Unable to cast object of type 'System.Activities.InArgument`1[System.String]' to type 'System.Activities.InArgument`1[Microsoft.Activities.DynamicValue]'."

 

Is this the correct way:

I am running a Run If

 

First part is when MobilePhoneRequired field is ticked (Yes/No). In my case is "Yes"

 

Second part (Where the problem is - I think??)

Field: LineManager is a Person/Group

In Value I have put an email address from that person/group field.

I think here is where the problem is.

 

So basically Run the command IF: MobilePhoneRequired = YES and When the LineManger = adam@xxx.onmicrosoft.com

 

Any advice please!

Thank you..

 

 

 

 

211670_CaptureFLOW.PNG

icon

Best answer by lazyme119 20 December 2017, 11:27

View original

17 replies

Badge +9

Try putting the value it equals to in a person/group variable using the Set Workflow Variable Action. Then add it there instead of manually typing out what it is.

Badge +5

Hi Chadd,

How do I set up a - Workflow Variable Action?

Any screenshots?

Thanks

Badge +9

Now that I look into it, I dont think that's going to work as a person/group variable because it makes you declare it at the start of the WF and we don't want that. But you might be able to try it as a text variable.

Then inside it create a new text variable(not a person/group), call it whatever you want and have it equal the email address you want to use. Then in the runif set it equal to that variable.

Also, is the format of the email address correct? You use onmicrosoft?

Badge +5

Hi Chadd,

I will try this out and met you know.

The onmicrosoft was just an example..Not a real address.

Thanks

Badge +5

Hi Chadd,

I triedyour method. I think i done the way you described it.

The error message doesn't appear anymore but the manager doesn't receive the email.

Have created a Workflow Variable (text) called var_LMtxt)

See screenshot of the settings of "Run If"

Badge +9

Well the good news is that it's definitely related to that. Let me see if I can reproduce in my environment.

Badge +5

Thanks Chadd...

It's very frustrating, but I have to wait and see if you can do it.

Will wait for good news.

Badge +9

try adding i:0#.f|membership| at the beginning of the email. I tested in my environment and you don't need to put in in a variable.

This works

Also, add a "Log to History List" action right before the runif. Add a list lookup current item and pull whatever LineManager equals so you can see the value and see if it matches the managers email you're entering.

Badge +5

ok, let me try this out...

Badge +5

Hi Chadd,

Have done what you said...getting this.

Than Save or Publish of the workflow. I get this..

Badge +5

Just to let you know that my LineManager  column in the list is a People Picker (Person/Group field)

Badge +9

Does LineManager selection of People only or People and Groups? Under Show field, is it just Name (with presence)? IS it marked for only one selection allowed?

Badge +5

Hi Chadd,

It worked when LineManager was set to: Allow multiple selections to NO

But when I changed to : Allow multiple selections to YES, than this problem started

Is this not allowed for some reason?

Userlevel 6
Badge +16

Perhaps you could use "contains" instead "equal"

Badge +9

Correct, that isn't allowed.

It's because you're using equals. The run if is expecting a single entry, so when it looks at the field (even if there is only 1 entry) because there's a possibility of more, it errors. The syntax doesn't match.

You can avoid this by setting LineManager to a Text Variable. Then in you runif, instead of When "List Lookup - current item" change it to When "Workflow Variables varLineManager" contains ManagerEmail@email.com

Badge +5

Hi Chadd,

Aha..ok we are getting there.

I will try this out and let you know.

Badge +5

Hi Chadd,

I tried it out but for some reasons it didn't work. It was taking up too much time.

What I did in the end (and it worked!!) was:

I have put back the LineManager to "Allow multiple selections to: NO"

And just created another column called LineManager2

Now the "Run if" just worked. I am sure there is a better way of doing this but this one worked for me.

Thanks for your time and patience, for sure you put me on the right direction in this process.

Thanks again,

Adam

Reply