sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Title + " is waiting in the lobby to fill out benefits and employment forms." Does not work

Open duncanspeidel opened this issue 7 years ago • 13 comments

When I execute the workflow the email I receive does not show the expected value of Title. The subject line is "is ready for HR paperwork" and the body is "is waiting in the lobby to fill out benefits and employment forms.". I changed the body of the email to just title and the workflow failed with a null exception. Instance 'd41a49c1-e681-40d4-b816-81eb23c929b3' of workflow 039c3889-ae63-4a9b-b4ce-169081759e4b Status: Started; Details: . Instance 'd41a49c1-e681-40d4-b816-81eb23c929b3' of workflow 039c3889-ae63-4a9b-b4ce-169081759e4b Status: SystemSuspended; Details: RequestorId: 26d34922-ffb2-6d44-0000-000000000000. Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.ArgumentNullException: Value cannot be null. Parameter name: Input at Microsoft.Activities.Expressions.IndexOfString.Execute(CodeActivityContext context) at System.Activities.CodeActivity`1.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation).

This tells me the Title variable is null but I do not know why. How can I either populate the variable or get a list of non-null variables that I can use in the email subject and body?


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

duncanspeidel avatar Sep 18 '19 15:09 duncanspeidel

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

msft-github-bot avatar Sep 18 '19 15:09 msft-github-bot

I know you had another issue open on this, but can you please provide full context here? Screenshot of the activity properties showing the Title property is set would be helpful, as the error states that it is not being set.

andrewconnell avatar Sep 19 '19 19:09 andrewconnell

The more context details you can provide, the easier it is to help assist on issues. Any code you can provide and/or screenshots of the issue also help. The easier you can make it to reproduce the issue, the easier and quicker it is for someone to help you. Things that always help posting with every issue include (1) SharePoint environment(s) (on-prem / SP 2016 / SP 2019 / SharePoint Online), (2) if SharePoint Online, is the tenant configured for standard / targeted release, (3) if SharePoint Framework, list the versions of installed tools (Node.js, NPM, Yeoman, Gulp, SPFx generator, etc... use npm list -g --depth=0), (4) if applicable, browser(s) tested, (5) if applicable, version of Office UI Fabric React & (6) anything else you can provide.

msft-github-bot avatar Sep 19 '19 19:09 msft-github-bot

The email I receive shows: "is waiting in the lobby to fill out benefits and employment forms." On the subject line. The body shows " is ready for HR paperwork". The Title variable is not getting populated. GetDynamicValue. This shows how I am trying to populate the title value. I also tried Title (LinkTitleNoMenu), same result. The email takes the form of: emailFromWorkflow.

I need to know how to properly populate the Title field. I selected Title from the drop down. I cannot debug this, the breakpoints are ignored.

Best regards, Duncan

duncanspeidel avatar Sep 19 '19 19:09 duncanspeidel

If I set subject or body to just Title it fails with the exception shown in the first post. It is clear to me that Title is not getting populated. It is not clear how to fix that.

duncanspeidel avatar Sep 19 '19 19:09 duncanspeidel

it's been a very long time since I've worked with workflow, but if I recall, you can't set the "Title (LinkTitle)" property. That is dynamically generated by SharePoint. Try setting property "Title"

andrewconnell avatar Sep 19 '19 20:09 andrewconnell

The drop down doesn't offer title. It offers Title(LinkTitle) or Title(LinkTitleNoMenu). I cannot enter free text. TitleChoices

duncanspeidel avatar Sep 20 '19 13:09 duncanspeidel

Sorry but I'm not sure... I'm certain you can't use the two "Title" options that you show in your screenshot. as those aren't real columns, they are dynamically generated based on the value in the "Title" field. As the screenshot in the article shows, you should have a column named "Title(Title)".

Looking back at the 3rd article in this series, I see in the section Modify the elements.xml file, step 2, it shows the TItle field is added with the DisplayName="Employee" ... have you tried setting the Employee field in the workflow?

andrewconnell avatar Sep 20 '19 13:09 andrewconnell

My employee.xml looks like:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!-- Parent ContentType: Item (0x01) -->
  <ContentType ID="0x01008CB8FAE3BA7C4894B8706227A7506CDB" Name="NewEmployee" Group="Employee  Orientation" Description="Represents a new employee" Inherits="FALSE" Version="0">
    <FieldRefs>
      <!--<FieldRef Name="Title" ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" DisplayName="Employee" />-->
      <FieldRef Name="LinkTitle" ID="{82642ec8-ef9b-478f-acf9-31f7d45fbc31}" DisplayName="Employee" />
      <FieldRef Name="Title" ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" DisplayName="Employee" />
      <FieldRef ID="{e532d801-1bb0-44ee-beca-c7b24eebda4e}" DisplayName="Division" Required="FALSE" Description="The division of the company where the employee works" Name="Division" />
      <FieldRef ID="{dd9bb4a5-2129-4cd8-bd95-a0e9b1086c65}" DisplayName="Orientation Stage" Required="TRUE" Description="The current orientation stage of the employee." Name="OrientationStage" />
    </FieldRefs>
  </ContentType>
</Elements>

I added the fields referenced in the Modify the elements.xml file.

duncanspeidel avatar Sep 20 '19 14:09 duncanspeidel

Repeating my last comment:

have you tried setting the Employee field in the workflow?

Don't understand in the snippet why you have TWO references to the title field, one commented out. That's unnecessary.

What you've done in the elements.xml file is you've added the Title column to the content type, but you've renamed it to Employee. That's why in my last comment, I suggested trying to set the value of the Employee field because that's the Display Name of the Title field.

If that works, then it seems like there's an error in the doc.

andrewconnell avatar Sep 20 '19 14:09 andrewconnell

Thank you, switching to employee worked.

duncanspeidel avatar Sep 20 '19 15:09 duncanspeidel

Closing issue as "answered". If you encounter similar issue(s), please open up a NEW issue. Thank you.

msft-github-bot avatar Sep 23 '19 16:09 msft-github-bot

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

msft-github-bot avatar Jan 23 '20 12:01 msft-github-bot