web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Get Field Value in a form From another form

(0) ShareShare
ReportReport
Posted on by 30

Hi everyone,

I want to get field value in a form from another form in same entity, can anyone help me for this.

I have the same question (0)
  • Suggested answer
    Wahaj Rashid Profile Picture
    11,321 on at

    Hi,

    Thank you for your query.

    Do you need to get a field's value in JavaScript on another form?

    If you mean to say you need to get value of a field on a different form within same entity, you just need to add same field on both forms.

    For example, I have a custom field called new_xyz which I added on Contact form.

    Now to access this value on a new Contact Form, you just need to add this field using following steps:

    • Go to Advanced Settings -> Customization - Customize this System.
    • Expand Entities -> <Entity Name> -> Forms.
    • Open the desired form, and from the right hand side (Field Explorer), drag the desired field on the form.
    • Save and Publish.

    Now you can access new_xyz field's value (in JavaScript) on new form.

    Also, if you do not need to show this field on new form, you can set it's visibly to false, this way Users won't see this field, but you can access it's value.

  • Vipin7060 Profile Picture
    30 on at

    Thank you Wahaj Rashid

    Actually I want to get field value from one form to another form in different field in same entity using javascript.

    For Example : An entity "opportunity" having two forms a and b , a have field a1 and b have field b1 , i want to get a1 field value from form "a" and set that value in field b1 in form "b" using javascript.

  • T.I.A Profile Picture
    1,760 on at

    and this is on the same record?

  • Suggested answer
    Nya Profile Picture
    29,060 on at

    Hi, Vipin7060

    You can create a Workflow to get the value you want.

    For example, there is a field called ‘num’ in Contact entity, which is only contained in the form ‘Contact for Interactive experience’.

    I’d like to get its value and set it into the form ‘Contact’ as the Business Phone.

    • Create a real-time workflow.
      1. Go to Advanced Settings > Settings > Processes. New a Process.1_2D00_1.png
      2. Select type as Workflow

    1_2D00_2.png

    • Set the ‘Start when’

    2_2D00_1.png

    2_2D00_2.png

    • Add a ‘Update Record’ step.

    3_2D00_1.png

    • Set properties

    5353.4_2D00_1.png

    • It can pass the value from the form ‘Contact for Interactive experience’ into ‘Contact’.

    5_2D00_1.png5_2D00_2.png

    Hope this helps.

    Best Regards,

    Nya

  • Vipin7060 Profile Picture
    30 on at

    Thanks Nya

    But I want this using Javascript bacause i also used some maths calculation

  • Suggested answer
    PabloCRP Profile Picture
    1,088 on at

    Hi Vipin7060,

    the easy approach could be to have both fields in your forms but  hidding field b from (form a) and hidding field a from (form b) and just passing the value

    assuming both field are the of same type then:

    function yourAwesomeFunction(context){
        var formContext = context.getFormContext();
        //here your logic...
        
        copyValue("new_FIELD_A","new_FIELD_B",formContext);
                         //OR
        copyValue("new_FIELD_B","new_FIELD_A",formContext);
    }
    
    function copyValue(fieldFrom,fieldTo,formContext){
    var fieldFromControl = formContext.getAttribute(fieldFrom);
    var fieldToControl = formContext.getAttribute(fieldTo);
    if(fieldFromControl===null||fieldToControl===null)
        return;
    fieldToControl.setValue(fieldFromControl.getValue());
    }

    regards.

    please consider marking as an answer if it was helpful

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
iampranjal Profile Picture

iampranjal 51

#2
Martin Dráb Profile Picture

Martin Dráb 39 Most Valuable Professional

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 26 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans