• Murilo Garcez
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies

I have a code that Parse the XML, using the BuildRowsetFromXML, so, I would like to put the link(of my XML) in my code to the code read the content inside of the link(XML) and then execute the code( to parse the content) and later show me the result in my web page

I tried to put the httpget(xml link), but did not worked

Follow what i tried

-

%%[

var @xml, @isXML, @nodes, @rowCount

set @xml =HTTPGet("https://XMLlink")
 

if indexOf(@xml,"<item>") > 0 then

  set @nodes = BuildRowsetFromXML(@xml,"/item",0)
  set @rowCount = rowcount(@nodes)

  if @rowCount > 0 then


      var @title
      var @price
      var @id
     
      
      
      set @nodepath = concat("/channel/item[",@i,"]/")
  
     
       if rowcount(BuildRowsetFromXML(@xml,concat(@nodepath,"id"))) > 0 then
          set @id = Field(Row(BuildRowsetFromXML(@xml,concat(@nodepath,"id"),0),1),'Value')
      endif
     
     if rowcount(BuildRowsetFromXML(@xml,concat(@nodepath,"price"))) > 0 then
              set @price = Field(Row(BuildRowsetFromXML(@xml,concat(@nodepath,"price"),0),1),'Value')
          endif

 if rowcount(BuildRowsetFromXML(@xml,concat(@nodepath,"title"))) > 0 then
              set @title= Field(Row(BuildRowsetFromXML(@xml,concat(@nodepath,"title"),0),1),'Value')
          endif
             
              
          
       
     if not empty(@title)) then
     
 

]%%
  <p> (%%=v(@price)=%%)  <br> (%%=v(@id)=%%) <br> (%%=v(@title)=%%)  </p>

I tried retrieve the records from my list and then try "updateitem" with Data Extension inside
but it's not working

 

<script runat="server">
 
    Platform.Load("core", "1");
 
    var api = new Script.Util.WSProxy();
 
 try {
 
 var res = api.retrieve("ListSubscriber", 
    ["SubscriberKey"],
    {
        Property: "ListID",
        SimpleOperator: "equals",
        Value: "xxxx"
    }
);
   
   var options = {
 SaveOptions: [
  {
   PropertyName: 'SubscriberKey',
   SaveAction: 'UpdateAdd'
  }
 ]
};
   var result = api.updateItem('Subscriber', {
 CustomerKey: "XXXXXXX-XXXXX-XXXXX-XXXXX"
 
}, options);
 Write(Stringify(res));
  
 } catch(error) {
  Write(Stringify(error));
 }
 
</script>
My web page returns the subscribers but do not update my Data Extension, any help about my code is useful, thanks in advance!

I tried retrieve the records from my list and then try "updateitem" with Data Extension inside
but it's not working

 

<script runat="server">
 
    Platform.Load("core", "1");
 
    var api = new Script.Util.WSProxy();
 
 try {
 
 var res = api.retrieve("ListSubscriber", 
    ["SubscriberKey"],
    {
        Property: "ListID",
        SimpleOperator: "equals",
        Value: "xxxx"
    }
);
   
   var options = {
 SaveOptions: [
  {
   PropertyName: 'SubscriberKey',
   SaveAction: 'UpdateAdd'
  }
 ]
};
   var result = api.updateItem('Subscriber', {
 CustomerKey: "XXXXXXX-XXXXX-XXXXX-XXXXX"
 
}, options);
 Write(Stringify(res));
  
 } catch(error) {
  Write(Stringify(error));
 }
 
</script>
My web page returns the subscribers but do not update my Data Extension, any help about my code is useful, thanks in advance!