Page 1 of 1

Data Conversion With Node Path Like InsertAndUpdateNode

Posted: April 10th, 2023, 6:34 pm
by JefferyD
The data conversion services generally take in a value or set of values and return converted versions of those values. However, for when working with a dynamic list that contains values to be converted, could an option be added to provide a location/path instead of the value(s) to the data conversion services and have them replace the previous value exactly where it was found?

Essentially, it would work like the InsertAndUpdateNode service except that it converts the value of all the found nodes instead of replacing or adding a child node to them.

Example
Given a path like WorkData/GetRecords/Output/Result/CreatedDate, the ToDate service could just modify the value of every instance of CreatedDate found in GetRecords directly.

Reason
I have found myself in situations where I have lists of records and want to convert a value of each record. In those situations:
  • Just converting the values gives me no way to determine where to put the converted value. The previous value is lost and any kind of record identifier cannot be included.
  • Using a Loop to only work on a single record at a time makes it easier to accomplish, but that requires a few extra steps and the performance impact seems to quickly add up as that total number of records increases. It can also be quite inconvenient if needed in multiple locations as it cannot be made into a reusable method due to InsertAndUpdateLoopNode.
  • By making it a single service, performance optimizations can be made to the service itself. For example, if there are duplicate values, then they can be replaced with the result of the first conversion instead of redoing the whole conversion again. This can be especially valuable if there are certain conversions that take a bit more time.

Re: Data Conversion With Node Path Like InsertAndUpdateNode

Posted: April 13th, 2023, 5:15 pm
by CathyC
I created this mockup to better illustrate the concept
image.png
All the From and To parameters on timezones and culture and format are still present, and still would be filled out as much as they are today, but instead of pulling out the value from the Inquire result, to put in this service, we tell the service to go to the source and change it there.

Re: Data Conversion With Node Path Like InsertAndUpdateNode

Posted: April 13th, 2023, 5:30 pm
by CathyC
I like this idea. Originally InsertAndUpdateNodes was created to do just this, but it relied on EASYProcess functions. Now that EASYProcess functions for date conversions are deprecated, it removed that functionality from insertandupdatenodes, but the service is still very powerful and widely used.

This would be introducing a new service (ToDateInPlaceConversion? ConvertToDateByNodePath? ToDateByPath? NodesValueToDate?) that accomplishes the same thing that we wanted to back then.

The duplicate dates inefficiency Jeff pointed out is probably the biggest reason this should be discussed. I didnt realize that my advanced date conversions (not using loop for greater efficiency) could still be improved upon until Jeff pointed it out, but at that point thought it would be unrealistic to add further complexity to achieve that efficiency level - though it would be nice.
It would be great to have a tool that does this built into EASYProcess

Re: Data Conversion With Node Path Like InsertAndUpdateNode

Posted: April 17th, 2023, 4:06 pm
by JefferyD
It looks like I previously made a similar suggestion as well. It includes another example and additional context, so I'm sharing it here:
viewtopic.php?p=369

Re: Data Conversion With Node Path Like InsertAndUpdateNode

Posted: April 28th, 2023, 3:32 pm
by JustinVanRegenmorter
Task 11394 has been created to discuss this feature.