playMaker

Author Topic: DataMaker Xml xPath and Json [ECOSYSTEM] [FEBRUARY 2022]  (Read 48181 times)

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 716
Re: DataMaker Xml xPath and Json [ECOSYSTEM] [NOVEMBER 2019]
« Reply #90 on: July 29, 2020, 09:52:42 AM »
Regarding the XML actions that are used to gather properties from nodes, I notice that if a property that is searched for does not exist in the current node (a node memorized from a previous action that saves it into a reference), the result field will return all the properties of the node's immediate children if looking for string values to store (this does not happen for var types that cannot be appended such as floats for example).

It turns out that string values are some of the most used var types for simple XML documents, so it would be nice to have a way to handle this problem. Or maybe it's a bug, I don't know.
But if it's done by design, here's a suggestion:

I think it would be better that when there is no proper result after looking for a given text property inside a node, that the result would be a null or a blank or anything the user would want to have this default value replaced with.

There could be a boolean flag titled noResultDefault (description: "default value to return if no corresponding property is found in the current node"):

   - true (default): then a field appears underneath this option, defaultPropertyValue. The user can set it to any type of var he wants (but here it would be a string, it might even be necessary to force the var type because, again, this problem only appears for var types that can be combined from multiple values), and then any type of default value that's going to be returned in case the corresponding property hasn't been found in the current node.

   - false: all text properties found and collectable on the node are returned.

If it's a bug or an incorrect design, then maybe the boolean isn't needed and we could go straight for a noResultDefault (with the same description) that would be a type+var/value field.

This would be used in all actions that are looking for properties.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15501
  • Official Playmaker Support
Re: DataMaker Xml xPath and Json [ECOSYSTEM] [NOVEMBER 2019]
« Reply #91 on: July 30, 2020, 03:08:17 AM »
Hi,

 thanks for these feedback. The variable bug is known unfortunatly, but I can't do anything, it has to be fixed internally within the playmaker API.

as for the nodes property gathering, I am aware of this problem but I can't decide within the code the result, it's up for interpretation, how do I know that the result of a missing node returned by the xml engine is actually the whole set of other nodes and not the actual expected result?

Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15501
  • Official Playmaker Support
Re: DataMaker Xml xPath and Json [ECOSYSTEM] [FEBRUARY 2022]
« Reply #92 on: February 18, 2022, 02:09:22 AM »
Hi Everyone,

 Small update with a fix on a csv action that was missing due to bad file naming. Utils and ArrayMaker got updated as well within the packages

Bye.

 Jean