Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How do I create a workflow that updates a date field based on text field?

Posted on by Microsoft Employee

Hello,

I have a hidden text field in my CRM Opportunity entity called "QW_RenewalDate" that gets populated based on a date field in QuoteWerks.  I have a 2nd field on my form called "New_RenewalDate" that has a "Date" data type.  How do I create a workflow that updates "New_RenewalDate" when the text field "QW_RenewalDate" gets populated or updated?  Is it possible to convert the data in the text field to a date field using a workflow?

Thanks!

*This post is locked for comments

  • Suggested answer
    Goutham A Profile Picture
    Goutham A on at
    RE: How do I create a workflow that updates a date field based on text field?

    The simplest way is that you can use a Business Rule , which is OOB.

    Please refer below

    https://community.dynamics.com/crm/f/117/t/266309

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How do I create a workflow that updates a date field based on text field?

    Hi @Kokulan,

    I was able to get this to work by switching to "ToDateTime", as you suggested.  Thank you so much for your help on this issue!

  • Suggested answer
    Kokulan Profile Picture
    Kokulan 18,048 on at
    RE: How do I create a workflow that updates a date field based on text field?

    Hi

    You have to use ToDateTime not IsDateTime.  Do you not have ToDateTime in the list of available steps?

    For the second step, the for Look For dropdown you have to select Date conversion step under local variables area.  Once you selected, the converted datetime value will be available for you to set to the new_renewaldate  field.

    new_renewaldate field will be on the form area in the workflow designer and you just have to set the output value from ToDateTime CWA.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How do I create a workflow that updates a date field based on text field?

    Hi Kokulan,

    Thanks so much for sending this!  I imported the workflow and tried to create this workflow.  However, I'm still running into an issue.  Below is my workflow:

    7183.Attachment1.PNG

    In the first step, I selected "IsDateTime" and set the qw_renewaldate field, which is a text field, as the field I want to convert to a date.

    In the 2nd step, I am updating the new_renewaldate field.  However, I'm still not seeing the qw_renewal date field in the dropdown, which is the field I want to update (The "Renewal Date" field shown in the dropdown below is the new_renewaldate field, not the qw_renewaldate field).

    Am I doing something wrong here?  Thanks!

     7183.Attachment1.PNG

  • Verified answer
    Kokulan Profile Picture
    Kokulan 18,048 on at
    RE: How do I create a workflow that updates a date field based on text field?

    Hi

    You could use the following Workflow Data Time utility to convert the date in text field to date time value using ToDateTime

    github.com/.../CRM-DateTime-Workflow-Utilities

    You could do this using your own code but this utility is very useful to deal with date-time values so it might be work importing this tool and using in a workflow to conver the value.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How do I create a workflow that updates a date field based on text field?

    Hi @Pravin,

    Any advice or sample code on how I can do this using JS?  I have no experience with JavaScript.  Thanks!

  • Suggested answer
    Pawar Pravin  Profile Picture
    Pawar Pravin 5,227 on at
    RE: How do I create a workflow that updates a date field based on text field?

    Hi,

    I think you should go through JS, its much easy to convert text to date in JS.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans