11 Replies Latest reply on Mar 18, 2018 5:34 AM by davidl14970702

    Linking Fields

    davidl14970702 Level 1

      I would like to set one field with an enumeration (on the left, below (@campaign_ministry_area)), and then have the selection be populated in another filed (on the right,webAnalytics/@tag1). I'm not 100% sure where to start.

      But both fields are on my extension of the delivery table, in my own namespace.

       

      The purpose of having both fields to is to set one within campaign, while the other gets processed to out web analytics account.

       

      I feel like I can do something like this

      <element externalJoin="true" label="Tag1" name="webAnalytics/@tag1" revLink="Delivery"

                   target="lw:delivery" type="link">

            <join xpath-dst="@id" xpath-src="@Campaign_Minisitry_Area"/>

       

      Any suggestions would be helpful.

       

      Link Data.png

        • 1. Re: Linking Fields
          Amit_Kumar Experience Cloud MVP

          Hi David,

           

          You need not change the schema you can go to the input form for the delivery and use below code to pick the value from one tab and use it in another?

           

          <enter>
              <set expr="Iif([@Campaign_Minisitry_Area]=='', 'defaultvalue', [@Campaign_Minisitry_Area])"
                   xpath="webAnalytics/@tag1"/>
          </enter>
          

           

          Note: ensure you are using correct Xpaths here

          Regards,

          Amit

          • 2. Re: Linking Fields
            davidl14970702 Level 1

            I added it but im nor seeing what i would have expected. I added it to the beginning of that container. Is defautvalue supposed to be defaultValue? proper V?

             

            delivery input form.png

             

            tag1.png

            • 3. Re: Linking Fields
              Amit_Kumar Experience Cloud MVP

              Hi David,

               

              To Make this work you have to load the xpaths into delivery so that your values can be loaded into the context which was saved before.

              attribute name will be like  xpathsToLoad="name of xpaths with comma separated values, which sometimes requires more changes based on the time when you want to see the change etc. in your case you can do it simply by using snippet:

               

               

               <postSave>
                  <if expr="@Campaign_Minisitry_Area != ''">
                    <set expr="Coalesce(@Campaign_Minisitry_Area, 'defaultvalue can be anything that you want as default')" xpath="webAnalytics/@tag1"/>
                    <set value="nms:delivery" xpath="/ignored/writer/delivery/@xtkschema"/>
                    <set value="update" xpath="/ignored/writer/delivery/@_operation"/>
                    <set expr="[@id]" xpath="/ignored/writer/delivery/@id"/>
                    <soapCall name="Write" service="xtk:persist">
                      <param exprIn="[/ignored/writer/delivery]" type="DOMDocument"/>
                    </soapCall>
                  </if>
                </postSave>
              

               

              Add this snippet just before the form closing tag in your input form. please ensure all xpaths names as I do not have access to your form.

              Remove previously suggested code change.

               

              Regards,

              Amit

              1 person found this helpful
              • 4. Re: Linking Fields
                davidl14970702 Level 1

                I doubled checked the xpaths, and I even added the fields in xpaths to load, and I'm still not seeing anything.

                • 5. Re: Linking Fields
                  Amit_Kumar Experience Cloud MVP

                  did you tried postSave method mentioned above, i just tested this and it is working fine for me.

                  • 6. Re: Linking Fields
                    davidl14970702 Level 1

                    amit_kr,

                    I believe I've done it as you have shown above. There must be something I am leaving out...None of my tests ave worked.

                     

                    This is what I currently have.

                    Delivereies (nms) input form.

                    xpathsToLoad="@Campaign_Minisitry_Area,webAnalytics/@tag1"

                     

                    Link Data.png

                    Lind Data 2.png

                    • 7. Re: Linking Fields
                      Amit_Kumar Experience Cloud MVP

                      Hi David,

                       

                      your If conditions is incorrect, it should be for postsave

                      <if expr="@Campaign_Minisitry_Area != ''"

                       

                      Regards,

                      Amit

                      • 8. Re: Linking Fields
                        davidl14970702 Level 1

                        I've updated to <if expr="@Campaign_Minisitry_Area != ''"> and i am still not seeing anything.

                        • 9. Re: Linking Fields
                          Amit_Kumar Experience Cloud MVP

                          Hi David,

                           

                          It's strange, Can you send me your Delivery schema and input form in a personal email at amitdeol@outlook.com?

                          I will try to execute that on my local system and I will respond back.

                           

                          Regards,

                          Amit

                          • 10. Re: Linking Fields
                            Amit_Kumar Experience Cloud MVP

                            Hey,

                             

                            I did a quick test and you have used incorrect XPath for tag1, use this and it will work!

                             

                            <postSave>

                               <set expr="Coalesce(@Campaign_Minisitry_Area, '')" xpath="/ignored/writer/delivery/webAnalytics/@tag1"/>

                                  <set value="nms:delivery" xpath="/ignored/writer/delivery/@xtkschema"/>

                                  <set value="update" xpath="/ignored/writer/delivery/@_operation"/>

                                  <set expr="[@id]" xpath="/ignored/writer/delivery/@id"/>

                                  <soapCall name="Write" service="xtk:persist">

                                    <param exprIn="[/ignored/writer/delivery]" type="DOMDocument"/>

                                  </soapCall>

                              </postSave>

                             

                            Regards,

                            Amit

                            • 11. Re: Linking Fields
                              davidl14970702 Level 1

                              I tried adding it and Im still not seeing it populate. Does the namespace matter at all? Should it be lw:delivery? Am I looking in the wrong spot?