[{"Title":"Execute script","Condition":"","ActionType":"EXECUTE_SCRIPT","ScriptBody":"{ return new Promise(function(resolve, reject){\r\n var context = new SP.ClientContext();\r\n //Use [[@Form.ListId]] for Forms and [[@List.Id]] for List actions\r\n var listId = [[@Form.ListId]];\r\n var list = context.get_web().get_lists().getById(listId);\r\n var listItem = list.getItemById([[ID]]);\r\n context.load(listItem);\r\n context.executeQueryAsync(function(s, e) {\r\n var values = listItem.get_fieldValues();\r\n //Set field values to global variable to use in Template file\r\n window.itemFieldValuesForDG = values;\r\n //Use debugger to stop execution and investigate what values you have\r\n //For lookup you need to use get_lookupValue or get_lookupId. window.itemFieldValuesForDG.Lookup1.get_lookupValue()\r\n //debugger;\r\n resolve();\r\n }, function (sender, args){\r\n reject(\"Failed to load item by ID. Error: \" + args.get_message());\r\n });\r\n \r\n}); }","FilePath":"","InternalName":"Execute_script"}]