You can try using a Code node for that:
.
If my reply answers your question, please remember to mark it as a solution.