How can I set a main field equal to a secondary field? - InfoPath Dev
in

InfoPath Dev

Qdabra® Active Directory Web Service

Use our Google Custom Search for best site search results.

How can I set a main field equal to a secondary field?

Last post 07-05-2022 08:35 AM by alo123. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 06-30-2022 02:35 PM

    How can I set a main field equal to a secondary field?

    I have two form views and on the default view, there is a field called PartNumber_Temp which is a part of a Secondary data. The second form view has a field called DesignPartNumber. I tried setting the DesignPartNumber equal to PartNumber_Temp so that I can see this value in the second form view but it doesn't display this value even though sharepoint shows DesignPartNumber having the value of PartNumber_Temp on the list. So on the form itself it doesnt show this value for DesignPartNumber but on the list it does. How can I make this possible?
  • 07-01-2022 08:45 AM In reply to

    Re: How can I set a main field equal to a secondary field?

    Does the form always query the secondary data source? When you use a secondary data source as a default value in the Main data source with that "refresh" checkbox selected, you'll need to make sure the secondary data is always present. You can test that by putting the secondary data source field on your form in the views you wish to see it, and then you can verify it has data. If it is not always queried, just use a rule to set DesignPartNumber to the field instead of using a default.
    Hilary Stoupa

  • 07-01-2022 10:50 AM In reply to

    Re: How can I set a main field equal to a secondary field?

    Im not sure what you mean by "does the form always query the secondary data".
  • 07-01-2022 11:04 AM In reply to

    Re: How can I set a main field equal to a secondary field?

    The form that is first viewed when an item is created has the secondary data source. After that form is submitted, I made sure to add that same secondary data source in the other form, but in this other form the secondary data source field is blank. I don't know why.
  • 07-01-2022 11:08 AM In reply to

    Re: How can I set a main field equal to a secondary field?

    I'm confused, I'm sorry. Are you talking about two separate InfoPath forms? Secondary data sources can be set to query on load or to be queried via rules, which is what I'm talking about. Feel free to attach your form (or forms) to a reply. You can only add one attachment per reply - just reply twice if you have two different forms you are talking about.
    Hilary Stoupa

  • 07-05-2022 07:27 AM In reply to

    Re: How can I set a main field equal to a secondary field?

    Sorry for the confusion. I wish I could attach more pictures to better explain myself. By two forms, I mean I have two views, as you can see from the attached picture. The default one has fields from the main data source and secondary data source, while the non default view has fields from the main data source.
  • 07-05-2022 07:29 AM In reply to

    Re: How can I set a main field equal to a secondary field?

    Here is the form. Hope this helps better understand what I am trying to do.
  • 07-05-2022 08:13 AM In reply to

    Re: How can I set a main field equal to a secondary field?

    I see now. So, you are on the right track with your submit rule - except you are setting the main data source field after you submit, which means the data doesn't get saved. Data entered into a secondary data source (like your XML data source) never is saved when the form is submitted - it will always default to whatever the source data values are. You could also reset the secondary data source on load, in the rule you are using to switch views, but I wouldn't. I would just remove the default values in the main data source and set the main data source values on the submit button in the New view. Don't set them on the "edit" view tho - the XML secondary data connection will be blank there. See attached - I modified the rules on the submit button in the new view and removed the default values from the main data source. Right click the linked form in the post header, save it locally. Right click the locally saved file and select Design to open in Design mode. As a side note, it is always easier for me to understand with a sample form than with screenshots :)
    Hilary Stoupa

  • 07-05-2022 08:26 AM In reply to

    Re: How can I set a main field equal to a secondary field?

    I cant seem to open the form you attached. I need domain permission.
  • 07-05-2022 08:30 AM In reply to

    Re: How can I set a main field equal to a secondary field?

    You have to download it and open it in design mode as per my instructions above: Right click the linked form in the post header, save it locally. Right click the locally saved file and select Design to open in Design mode.
    Hilary Stoupa

  • 07-05-2022 08:35 AM In reply to

    Re: How can I set a main field equal to a secondary field?

    Okay, it didn't seem to work the first few times for seem reason but it works now. Thanks.
Page 1 of 1 (11 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.