Nintex Connect

The Official Community Site for Nintex Software Products, including Nintex Workflow 2007, 2010 and 2013; Nintex Workflow for Project Server 2010; Nintex Reporting 2008 and Nintex Analytics 2010; Nintex Forms 2010; Nintex Live and Nintex SmartLibrary.
Welcome to Nintex Connect Sign in | Join | Help
in Search

Performing an 'if greater than ...' on Item Properties

Last post 09-07-2012, 4:52 PM by Vadim_Tabakman. 15 replies.
Page 1 of 2 (16 items)   1 2 Next >
Sort Posts: Previous Next
  •  08-16-2012, 3:56 AM 24520

    Performing an 'if greater than ...' on Item Properties

    I am trying to create a workflow so that when the following listed fields are entered by the User, the length must be checked to see whether it is above the specified number of characters:

    • Name of Project – 64 characters
    • Summary Description – 255 characters

    If the length is too large:

    • Truncate the field to the maximum length
    • Create an email to the Current Owner  

    How do I check in the “Set Condition” if, “Name of Project” or the “Description” are greater than 64 characters and 255 characters respectively? Does their data type have to be converted before doing so?

    I’m very new to this and couldn’t find information on this elsewhere, so any help is much appreciated.

    Thanks.

  •  08-20-2012, 4:11 PM 24570 in reply to 24520

    Re: Performing an 'if greater than ...' on Item Properties

    Hi Ross,

    You would be looking at the following:

    1. Build String action to perform a fn-Length inline function call on your field.

    2. Store the result in a text variable

    3. Add a Convert Value action to convert the text variable into a number and store it in a number variable.

    4. Then use the Set a Condition action to do your "greater than" condition check.

  •  08-21-2012, 9:12 AM 24593 in reply to 24570

    Re: Performing an 'if greater than ...' on Item Properties

    For the actual truncation following the 'Set Condition', would I be right in creating a Build String action to perform a fn-SubString inline function call on the field.

    For example:

    fn-Substring({ItemProperty:Summary_x0020_Description},0,254)

    And then finishing the workflow by storing the result in the text variable.

    Have I left something out?

  •  08-21-2012, 11:53 AM 24602 in reply to 24593

    Re: Performing an 'if greater than ...' on Item Properties

    Hi Ross,

    that would be the way to do it. :)

  •  08-22-2012, 5:33 AM 24623 in reply to 24602

    Re: Performing an 'if greater than ...' on Item Properties

    Thanks for the replies Vadim.

    The substring function is not functioning as expected. It does not truncate “Summary Description” at all in the actual SharePoint at the moment.

     

    The substring function is also used within an email notification on “Summary Description” but it is truncating this to various random lengths. In the notification the Summary Description is as follows:

     

    fn-Substring(Summary Description,0,254)

     

    Can you see where I am going wrong? 

     

  •  08-22-2012, 1:38 PM 24641 in reply to 24623

    Re: Performing an 'if greater than ...' on Item Properties

    Hi Ross,

    what exactly are you getting when you make this inline function call?

     eg.

    fn-Substring(Summary Description,0,254)

    I would expect the output to be :

    Summary Description

    Are you getting something different?

  •  08-23-2012, 6:19 AM 24658 in reply to 24641

    Re: Performing an 'if greater than ...' on Item Properties

     

    When the following is typed into Summary Description, the letters at the end from t to e should be truncated:

     

    1234567890123456789012345678901234567890123456789012345678901234567890

    1234567890123456789012345678901234567890123456789012345678901234567890

    1234567890123456789012345678901234567890123456789012345678901234567890

    12345678901234567890123456789012345678901234truncate

     

    For the actual item entry in the SharePoint, the Summary Description does not truncate any of the above at all.

    Following the Set Condition to check ‘is greater than 255' I do the following:

     

    Build string, Perform truncation on Summary Description

                fn-Substring({ItemProperty:Summary_x0020_Description},0,254)

                Store Result in: Text

     

    Update Item

                Update-Current item

                Field-Select fields to update

    Summary Description-Equals: Value: Summary Description

    Send notification:

    --- 

    The field Summary Description was too long.

     

    It has been truncated to the maximum length:

     

    Text

    ---

     

    A few different workflow sequences have been tried but I hope this most recent attempt helps explain the general direction currently being taken.

  •  08-23-2012, 4:57 PM 24670 in reply to 24658

    Re: Performing an 'if greater than ...' on Item Properties

    Hi Ross,

    I tried a simple NW2010 workflow that did the fn-SubString and it seemed to work and truncate a 262 length piece of text to 254 characters.

    Download it here

  •  08-27-2012, 5:09 AM 24729 in reply to 24670

    Re: Performing an 'if greater than ...' on Item Properties

    That helps Vadim.

     

    To expand on my opening post where I am checking two fields (more have since been added) containing User entry, the length must be checked to see whether it is above the specified number of characters:

     

    • Name of Project – 64 characters
    • Summary Description – 255 characters
    • Cycle Time Improvements for Operations – 255 characters
    • ...[Umteen more field names.]

    If the length is too large, an email is sent to the Current Owner specifying which fields were truncated - can just one email be created to specify the fields that are too long?

    And in the notification, how do I specify which particular fields were too long and have been truncated?

    Thanks.

  •  08-27-2012, 11:16 AM 24741 in reply to 24729

    Re: Performing an 'if greater than ...' on Item Properties

    hi Ross,

    you'd need to build logic into your workflow to figure out first, which field is too long.

    Store the name or some valid information in a text variable.

    Then, you could have the one Send Notification action, and into the body, insert your text variable that contains the name of the field that was too long.

  •  08-31-2012, 5:04 AM 24862 in reply to 24741

    Re: Performing an 'if greater than ...' on Item Properties

    I’m not sure about the details here.

     

    For example, where all of the fields which require their length to be checked within “fn-Length” are placed within the Build String function:

     

    fn-Length({ItemProperty:Summary_x0020_Description}, {ItemProperty:Cycle_x0020_Time_x0020_Improveme}, {ItemProperty:Quality_x0020_Improvement}

    {etc.}

    {etc.}

    )

     

    And then convert the value to an integer – fieldInt.

     

    This does not work as it cannot carry all of the values. Surely each Item Property requires its own Build String action in order to use the length function within it??

  •  09-02-2012, 3:35 PM 24887 in reply to 24862

    Re: Performing an 'if greater than ...' on Item Properties

    Hi Ross,

    yeah, if you need the length of each one, you'd need to do each one in it's own Build String action.

  •  09-06-2012, 12:16 PM 24959 in reply to 24887

    Re: Performing an 'if greater than ...' on Item Properties

    Although the length of each string needs its own Build String function in order to determine the length, can the truncation be performed within one ‘Build String'? - As below:

    fn-Substring({ItemProperty:Summary_x0020_Description},0,255, {ItemProperty:Cycle_x0020_Time_x0020_Improveme},0,255{ItemProperty:Quality_x0020_Improvement},0,255

    )

    And then storing the truncated fields in a ‘result' variable (single line of text). Am I on the right lines here?

    I would then create a ‘Log in History' field with the following:

    substring = '{WorkflowVariable:result}'

    This would then enable me to insert the ‘result' variable into the send notification/email notification which I hope will display ONLY the fields that were too long and have been truncated.

    Is my logic above correct?

  •  09-06-2012, 12:33 PM 24964 in reply to 24959

    Re: Performing an 'if greater than ...' on Item Properties

    Hi Ross,

    I'm not really sure what you're trying to do with this statement:

    fn-Substring({ItemProperty:Summary_x0020_Description},0,255, {ItemProperty:Cycle_x0020_Time_x0020_Improveme},0,255{ItemProperty:Quality_x0020_Improvement},0,255)

     It looks like you are trying to pass 9 parameters to the fn-SubString and that won't work.

    Are you trying to get the substring of 3 separate fields and then concatenate them?  If that is it, you'd be looking at something like this :

    fn-Substring({ItemProperty:Summary_x0020_Description},0,255)fn-Substring({{ItemProperty:Cycle_x0020_Time_x0020_Improveme},0,255)fn-Substring({{ItemProperty:Quality_x0020_Improvement},0,255)

    You can test this out by opening a Build String action, clicking on the Run Now in the ribbon and trying something like this:

    fn-SubString(abcde,0,3)fn-SubString(fghij,0,3)fn-SubString(klmno,0,3)

    You should see a result of:

    abcfghklm

     

  •  09-07-2012, 11:41 AM 24991 in reply to 24964

    Re: Performing an 'if greater than ...' on Item Properties

    Sorry for my lack of knowledge in my postings, only learnt of the existence of NW recently. I must have picked this up wrong from reading the following post: http://connect.nintex.com/forums/permalink/4119/4899/ShowThread.aspx#4899

    I was replicating the example used in this workflow as demonstrated by Peter D, shown below:

    fn-SubString({WorkflowVariable:testtext},{WorkflowVariable:sub string index},{WorkflowVariable:characters from the right})

    But this probably is not relevant to what I'm doing.

    fn-Substring({ItemProperty:Summary_x0020_Description},0,255)fn-Substring({{ItemProperty:Cycle_x0020_Time_x0020_Improveme},0,255)fn-Substring({{ItemProperty:Quality_x0020_Improvement},0,255)

    Can you tell my why 2 curly brackets are needed to precede the two fields after Summary Description?

    No, not looking to concatenate, just to truncate.

    I am using NW2010 but I do not see the "Run Now" option.

    Does the second half of my logic in my previous post does not make sense (again I have used some of the logic from the aforementioned post) or do I need to go back to the drawing board?

Page 1 of 2 (16 items)   1 2 Next >
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems