I want to be able to generate a new sitemap xml file everytime new records are added to the database.
I use a trigger which make a HTTP get request to fetch data from an API endpoint. I managed to get get the list ok and store in a property like this:
Thanks @MutedJam and will give it ago…It would probably take weeks of trial and error to get it to work. I have very little knowledge of javascript or programming
Any help you can offer in adapting it, would be much appreciated. Thanks
This example first mocks the data you already have. It then applies the escaping required for sitemaps and then wraps everything under the required tags from sitemaps.org - Protocol before returning the result.
As you can see there are some unexpected opening and closing double quotation marks as well as extra backslashes (like this version=\“1.0\”) and also the \n as well, not required.