May 03 2023 07:59 AM
On Tuesday evening 4/25 after 6pm CST I noticed an error with power automate running the SharePoint HTTP control to call the API
_api/Microsoft.Sharepoint.Utilities.WebTemplateExtensions.SiteScriptUtility.ExecuteTemplateScript()
of
Action 1 (createSPList) is invalid. Parameter addNavLink has an invalid value.
This was due to a change in the JSON generated by the SharePoint HTTP control calling the API
_api/Microsoft.Sharepoint.Utilities.WebTemplateExtensions.SiteScriptUtility.GetSiteScriptFromList()
It appears that something has changed. The snippet below of the top of the json worked minutes before.
But changed to the snippet below that began producing the error.
May 04 2023 02:04 PM
May 07 2023 10:05 AM
May 08 2023 04:13 PM
May 09 2023 07:22 AM
May 09 2023 10:32 AM - edited May 09 2023 11:02 AM
Do you have any more detailed instructions on how you resolved this? Trying to resolve this for a client and it's time sensitive.
EDIT: Thanks to your hint pointing me in the right direction, I figured it out. For anyone who finds this topic later:
Instead of a request body like this:
{"script": "{\"actions\":@{replace(replace(string(variables('GetSiteScriptFromList')?['actions']),'\','\\'),'"','\"')}}"}
It should now look like this:
{"script": "@{replace(replace(string(variables('GetSiteScriptFromList')),'\','\\'),'"','\"')}"}
Note that the entire getSiteScriptFromList object can now be referenced between the quotes in the script property, instead of referencing a specific property, and the {} are no longer needed as they are included in the object:
{"script": "YourFormattedGetSiteScriptFromListStringHere"}
May 30 2023 07:06 AM
I had a similar issue with my flow. It worked fine without the bindings in the body of my REST call until last Friday, but thanks to @DeanOfReply's and @Stephen600's examples I was able to figure it out. If you're using the setProperty function to rename your new list, the body should look something like this in order to add the bindings:
{"script": "{\"actions\": [@{replace(replace(string(setProperty(body('Parse_JSON')?['actions'][0],'listName', variables('BackupTitle'))),'\','\\'),'"','\"')}], \"bindings\": @{replace(replace(string(body('Parse_JSON')?['bindings']),'\','\\'),'"','\"')}}"}
In my case, I'm using the output of a Parse JSON step instead of a variable to store the list structure. If you're renaming the list in a variable, you may need to use addProperty to add bindings back into your JSON since setProperty will only return the actions part when you use it to set the new name.