Task chaining with Application Automation

Overview

In this tutorial, you are going to learn how to use Qlik Application Automation and webhooks to chain analytics reloads in Qlik Cloud using events. This avoids the need for long-running automations, polling, or external systems and data, with each automation run lasting a couple of seconds rather than a couple of hours.

If you are new to this topic, first read the reloads overview.

If you prefer scheduling instead, continue reading, as this tutorial includes a scheduled example. For those interested in using code from within your own infrastructure, see task chaining using polling with qlik-cli. Additionally, you can define the reload order within a long-running automation using the templates built into Application Automation.

Reloading using webhooks and the Reloads API

A reload in Qlik Cloud emits a reload finished event upon completion. You can subscribe to this event within Qlik Cloud to promptly initiate other reloads using the Reloads API.

Learn more about webhooks in Qlik Cloud and webhook triggers in the Qlik Cloud connector.

How the task runner automation works

This automation is designed to be configured and deployed by a tenant administrator. It has the following configuration variables:

  • Variable prefixForChain sets the tag prefix used to detect tags indicating apps to reload next. By default this is next-, so it will pick up tags of the format next-<app GUID> (for example, next-17dfd44a-746b-48fa-9cf4-f83411f50375 will trigger a reload of an app with ID 17dfd44a-746b-48fa-9cf4-f83411f50375).
  • Variable defaultTolerance sets the minimum duration after a previous reload in which a new reload will be triggered. This prevents apps from being reloaded too regularly, or causing reload storms. By default, this is 10, representing 10 minutes.
  • Variable onlyManagedSpaces indicates whether apps should only be reloaded if found in managed spaces. By default, it is set to 0, so it will attempt to reload any apps (not just those in managed spaces).
  • Variable autoResolveAccessIssues determines whether the automation attempts to add access to the space for the app it is attempting to reload, if it doesn’t already have access under the current user. By default, it is set to 1, so it will add the current user to any spaces where they do not have permission to access data connections or start a reload of an app with full permissions. When apps are in personal spaces, or use data connections in spaces other than the app space (and the current user does not currently have access), it will not be successful.

When configured with the default values, the automation operates as follows:

  1. Starts when called by the webhooks service after the qlik.v1.app.reload.finished event is emitted.
  2. Uses the metadata in the qlik.v1.app.reload.finished event to look up the app in the tenant. This is to retrieve the list of tags on that app.
  3. Reviews the tags on the app for any prefixed with next-.
  4. Loops over any matching tags found on the app, retrieving the app information, space information, and last reload of each.
  5. If the last reload was less than 10 minutes ago, or is still running, or if the app cannot be found, skip the reload.
  6. If the current user doesn’t have access to the app space, add the user to the space with full roles (review roles for more information).

Once the reloads of any apps started by this automation have completed, a new event will be emitted for each reload, and the automation will start for each of those events. Each run of the automation is triggered by an app reload.

Note: If you would rather use a service account for reload chains, you can create an OAuth client and do the same activities using the Qlik Platform Operations connector in Application Automation. Learn more about that connector in the Platform Operations no-code guide.

Create a reload task

The first task in your reload chain should have an associated reload task. You can configure this in the Qlik Cloud hub. Once the chain is initiated, all subsequent tasks will be triggered directly by your automation.

Set up a reload task with a schedule

The schedule you set in this task determines the frequency of other reloads in the chain, since it initiates the entire process.

In this example, it creates a very simple reload flow which reloads four apps/scripts after a scheduled reload of the Extract data from finance system script:

  • Script Extract data from finance system in space Data prep, on success:
    • Script Transform finance data in space Data prep, on success:
      • Qlik Sense app Finance historical in space Finance
      • Qlik Sense app Finance analytics in space Finance
      • Qlik Sense app Finance Exec in space Finance

Create a reload chain

With the reload task created for your first app, find your second app in the Qlik Cloud hub. Right-click the app and select Details.

Look up the App or Script ID for your target content

This view will show either an App ID for Qlik Sense apps or a Script ID for load scripts, which you must reference when triggering a reload.

Next, go back to your first app or load script in the hub. Right-click and select Rename, then add tags to the item.

Add the ID of the target item to the source item

Prefix the ID of the target content with next- (for example, next-82353b5d-9a9c-4022-9aa4-7a0e5da8a838), drop it into the tags section, select the newly created tag, and click Save to exit.

The tag will be visible on the item card, and in the detail view for the item

Repeat this process for each app you need to trigger from the source or move to the target to add tags for its targets. Once tags are set up, you’re ready to import the automation.

Configure the automation

Create a new automation from the Qlik Cloud hub, and name it Reload runner. Import the automations from the full automation snippet section:

In the example, the first block should be configured by:

  1. Select the first Start block.
  2. Set the run type to Webhook.
  3. Select the Qlik Cloud Services connector from the dropdown.
  4. Filter to Reload finished events only.

This will create a webhook in the tenant that calls this automation. The webhook will show as having been created by the current user.

Run the automation

The automation will automatically start on any reload in the platform. Trigger a reload of your first app from the hub by selecting Reload now.

A run will be triggered for the reload, and it'll pick up the tags from the item

The automation will pick up the run, and the associated tags, stripping next- and attempting to start reloads of those items. If it fails for any reason, it will report this in the output and run title.

This reload triggered the next reload, which had links to the dashboard apps in:

The next reload picked up more tags, and triggered multiple apps

As the dashboard apps had no tags on, their reloads were detected, but no further action was taken.

The resulting chain of automations that triggered the reloads

All output is logged to the automation console, and could be logged to other sources as needed. The five automation runs triggered from reload finished events drove the reloads of the apps in the pattern configured in tags on those resources.

Scheduled alternative

If you prefer the automation not to execute every time a reload completes in your tenant, you can opt to use a variant which checks for all successful reloads since the last run.

This automation is largely the same as the webhook version, with additional blocks at the beginning to:

  • Determine the last run of the automation.
  • Retrieve all qlik.v1.app.reload.finished events that occurred since that timestamp.

As a result, the automation scans multiple apps at once to trigger ongoing tasks.

A single run of this automation can trigger many target apps from many source apps

How frequently you schedule this automation to run will determine how quickly new reloads start after the completion of previous reloads in the chain. For example, running it every 15 minutes would result in nearly 3,000 runs per month. If your environment has fewer reloads than this or if you require reloads to start as soon as possible after the preceding app finishes, consider using the event-triggered automation.

Summary

Reloading apps is required to obtain the latest data for a Qlik Sense app. For large deployments, reloads are multi-layered and often generate datasets as part of a downstream app reload. Chaining reloads together simplifies this process significantly.

Using this automation, a single administrator can configure a runner which any user in the tenant can use to chain their reloads. This approach is scalable and includes safeguards against users reloading apps too frequently.

You can customize this example with per-user, per-space, per-group restrictions by adding in checks for other metadata from the Qlik Cloud APIs.

Full automation snippet

To import one of these snippets to your own automation, either:

  • Save the snippet as a JSON file, right-click the canvas in an automation, and select Upload workspace.
  • Copy the snippet to the clipboard, right-click the canvas in an automation, and select Paste blocks.
Full automation snippet - webhook version

This is the webhook-triggered version.

{"blocks":[{"id":"2A22DF92-FFB1-43D4-B90C-8A0158B03280","type":"StartBlock","disabled":false,"name":"AppReloadFinished","displayName":"App Reload Finished","comment":"","childId":"1A6DD300-BAC9-4067-A459-47BDE9235CD3","inputs":[{"id":"run_mode","value":"webhook","type":"select","structure":{}},{"id":"datasourcetype_guid","value":"61a87510-c7a3-11ea-95da-0fb0c241e75c","type":"select","displayValue":"Qlik Cloud Services","structure":[]},{"id":"webhook_event_guid","value":"2ad48ec0-889f-11eb-91d9-d92131915ff0","type":"select","displayValue":"App Reload Finished","structure":[]},{"id":"webhook_param_4d669700-5ddb-11ec-b6db-59878ae0ea82","value":null,"type":"string","structure":[]},{"id":"test_payload","value":"{\n  \"data\": {\n    \"id\": \"example_94a789ad-d967-4049-8aaf-9abac267c222\",\n    \"name\": \"example_succesful reload test 2\",\n    \"size\": {\n      \"memory\": 330\n    },\n    \"errors\": [],\n    \"status\": \"ok\",\n    \"endTime\": \"2021-09-09T09:26:52.849Z\",\n    \"duration\": 395,\n    \"reloadId\": \"example_6139d35322f4b7b6f66b1444\",\n    \"warnings\": [],\n    \"peakMemoryBytes\": 3894208\n  },\n  \"source\": \"com.qlik/engine\",\n  \"eventId\": \"example_2f6517c2-388a-4e28-803e-7491a0185b86\",\n  \"eventTime\": \"2021-09-09T09:26:52Z\",\n  \"eventType\": \"com.qlik.v1.app.reload.finished\",\n  \"extensions\": {\n    \"userId\": \"example_BlVarUAUM9I0ei3MmKMejlDaF1sKPnN5\",\n    \"tenantId\": \"example_WL69WlNT4PRbwAA8EZ1sDblqjthluHL1\",\n    \"topLevelResourceId\": \"example_94a789ad-d967-4049-8aaf-9abac267c222\"\n  },\n  \"contentType\": \"application/json\",\n  \"eventTypeVersion\": \"1.0.0\",\n  \"cloudEventsVersion\": \"0.1\"\n}","type":"json","structure":[]},{"id":"webhook_documentation","value":null,"type":"string","structure":{}}],"settings":[{"id":"automations_censor_data","value":false,"type":"checkbox","structure":{}}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":0,"y":0,"logo":"https://cdn.qlikcloud.com/automations/logos/a2649cabda63b339ebc68a0c8d028f08.png"},{"id":"1A6DD300-BAC9-4067-A459-47BDE9235CD3","type":"VariableBlock","disabled":false,"name":"defaultTolerance","displayName":"Variable - defaultTolerance","comment":"If an app has successfully finished a reload within this many minutes, do not reload it again","childId":"B6AACF94-D43C-4DC7-AAAB-FE65C57409D2","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":0,"y":120,"variableGuid":"6FF47268-DA75-48B7-90CC-0DEE013758E4","operations":[{"id":"set_value","key":"7DF50A3F-4FA3-49AB-9D73-BC715139150E","name":"Set value of { variable }","value":"10"}]},{"id":"1452553A-8444-4BCD-9C4C-2DCCD0108E0D","type":"VariableBlock","disabled":false,"name":"prefixForChain","displayName":"Variable - prefixForChain","comment":"Set the tag prefix for the reload chain, e.g. `next-`.","childId":"815E4CD6-74EA-41F1-8988-424CA2829CE5","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":0,"y":240,"variableGuid":"D8332648-F08B-4584-BF87-34ED2964F523","operations":[{"id":"set_value","key":"F549C126-CCD5-40E8-AC89-51A8033EA0E4","name":"Set value of { variable }","value":"next-"}]},{"id":"899CC8F3-4BA0-455E-87A4-A8FD43101F83","type":"VariableBlock","disabled":false,"name":"iter","displayName":"Variable - iter","comment":"","childId":"C81CC91D-FDCE-4452-8AD0-45873EE1C41A","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":0,"y":840,"variableGuid":"C9D9B5AF-5529-4D6A-AA0A-82C12E09013B","operations":[{"id":"set_value","key":"EDDB12AD-2EB4-4CEE-B376-E80FB3F5EBFB","name":"Set value of { variable }","value":"0"}]},{"id":"C81CC91D-FDCE-4452-8AD0-45873EE1C41A","type":"VariableBlock","disabled":false,"name":"iterReloadsTriggered","displayName":"Variable - iterReloadsTriggered","comment":"","childId":"6692F62D-AC8F-4CF8-BA65-659F6E3D0AAC","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":0,"y":840,"variableGuid":"692444FC-47A7-4808-9FE3-3240D8142DE1","operations":[{"id":"set_value","key":"80E494BA-2524-4F17-9DFF-858D6AC91EC4","name":"Set value of { variable }","value":"0"}]},{"id":"6FFA9A5C-90F0-4FB0-ABF0-A3022296A1EB","type":"ShowBlock","disabled":false,"name":"output2","displayName":"Output 2","comment":"","childId":null,"inputs":[{"id":"input","value":"| [{ $.rawAPIRequest2.data[0].resourceId }]({ $.tenantHostname }/item/{ $.rawAPIRequest2.data[0].id }/details) | { $.rawAPIRequest2.data[0].name } | [{ $.getSpace.name }]({ $.tenantHostname }/catalog?space_filter={ $.rawAPIRequest2.data[0].spaceId }) | [{ $.appId }]({ $.tenantHostname }/item/{ $.rawAPIRequest3.data[0].id }/details) | {$.rawAPIRequest3.data[0].name} | [{ $.getSpace2.name }]({ $.tenantHostname }/catalog?space_filter={ $.rawAPIRequest3.data[0].spaceId }) | [{ $.DoReload.status }]({ $.tenantHostname }/item/{ $.rawAPIRequest3.data[0].id }/history) |","type":"string","structure":[]}],"settings":[{"id":"display_mode","value":"add","type":"select","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":720,"y":3260},{"id":"BF0D6CFE-D990-4BEF-AE72-FABC0AFFF269","type":"EndpointBlock","disabled":false,"name":"rawAPIRequest2","displayName":"Qlik Cloud Services - Raw API Request 2","comment":"Retrieve the tags from the app by fetching the item","childId":"42CDA414-766D-464C-A7E6-368CB0EB6187","inputs":[{"id":"4add8960-2078-11ec-be2c-7fc55d771fe6","value":"items","type":"string","structure":[]},{"id":"3b992a40-2072-11ec-9f0e-ed01586a7e1b","value":"3ba1eed0-2072-11ec-aa67-f118ee53373a","type":"select","displayValue":"GET","structure":[]},{"id":"3b8b9090-2072-11ec-8c77-5195fbb0ca65","value":[],"type":"object","mode":"keyValue","structure":[]},{"id":"993585d0-2839-11ec-b431-df4deed6c1ae","value":[{"key":"resourceId","value":"{$.AppReloadFinished.extensions.topLevelResourceId}"},{"key":"resourceType","value":"app"}],"type":"object","mode":"keyValue","structure":[]}],"settings":[{"id":"blendr_on_error","value":"stop","type":"select","structure":[]},{"id":"cache","value":"0","type":"select","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":0,"y":360,"datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","endpoint_guid":"3b75dd80-2072-11ec-9043-3b2aff6123af","endpoint_role":"get"},{"id":"1CEC28C3-29F4-40B4-BAD9-D4BD8B53126F","type":"VariableBlock","disabled":false,"name":"iterReloadsFailed","displayName":"Variable - iterReloadsFailed","comment":"","childId":"0BCE4F6C-34CA-499D-A14B-20CF4F978674","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":250,"y":960,"variableGuid":"7F5E536A-0F92-4C59-880A-FC49F980FFF3","operations":[{"id":"set_value","key":"80E494BA-2524-4F17-9DFF-858D6AC91EC4","name":"Set value of { variable }","value":"0"}]},{"id":"0BCE4F6C-34CA-499D-A14B-20CF4F978674","type":"ForEachBlock","disabled":false,"name":"loop","displayName":"Loop","comment":"Filter down tags to those which begin with prefix by looping over tags. There will only be one resource returned each request due to the GUID.","childId":"CE54D05C-9720-4CC3-9D7E-9E71C9F06E5C","inputs":[{"id":"input","value":"{ $.rawAPIRequest2.data[0].meta.tags[*].name }","type":"string","structure":[]}],"settings":[{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-355,"y":876,"loopBlockId":"D4B85F3D-5262-4113-92A3-631369AE97C5"},{"id":"D4B85F3D-5262-4113-92A3-631369AE97C5","type":"IfElseBlock","disabled":false,"name":"condition","displayName":"Condition","comment":"If tag contains prefix","childId":null,"inputs":[{"id":"conditions","value":{"mode":"all","conditions":[{"input1":"{$.loop.item}","input2":"{$.prefixForChain}","operator":"contain"}]},"type":"custom","structure":[]}],"settings":[],"collapsed":[{"name":"both","isCollapsed":false},{"name":"yes","isCollapsed":false},{"name":"no","isCollapsed":false}],"x":228,"y":1552,"childTrueId":"7814EAA5-161A-4A8F-9DAF-F8CE0C34DB24","childFalseId":null},{"id":"0983FEAC-2E88-4BCC-A0E0-954D6152FF66","type":"SnippetBlock","disabled":false,"name":"DoReload","displayName":"Qlik Cloud Services - Do Reload","comment":"Attempt the reload","childId":"6541DE19-BE31-4A68-90E5-A75F490BE606","inputs":[{"id":"29603390-e716-11ea-9e37-05e08ee32111","value":"{ $.appId }","type":"string","structure":[]},{"id":"2ac9eef0-a677-11eb-aacc-8b755d0fe484","value":"Start reload and continue","type":"select","displayValue":"Start reload and continue","structure":[]},{"id":"6892c0c0-c795-11eb-9860-9dc8cb705e25","value":null,"type":"select","structure":[]},{"id":"ecebf340-c797-11eb-8671-53658babb1a1","value":null,"type":"select","structure":[]}],"settings":[{"id":"blendr_on_error","value":"warning","type":"select","displayValue":"Warning - Continue Automation and report errors","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":600,"y":3060,"datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","snippet_guid":"b5dbb7a0-e715-11ea-b2bf-43bb35adee19"},{"id":"97AD1046-86ED-4C14-AF68-9282A68F43E2","type":"IfElseBlock","disabled":false,"name":"condition2","displayName":"Condition 2","comment":"If previous reload succeeded or there hasn't been a reload","childId":null,"inputs":[{"id":"conditions","value":{"mode":"some","conditions":[{"input1":"{$.rawAPIRequest.data[0].status}","input2":"SUCCEEDED","operator":"="},{"input1":"{$.rawAPIRequest.data[0].status}","input2":null,"operator":"empty"}]},"type":"custom","structure":[]}],"settings":[],"collapsed":[{"name":"both","isCollapsed":false},{"name":"yes","isCollapsed":false},{"name":"no","isCollapsed":false}],"x":240,"y":1980,"childTrueId":"65751E0D-3FA8-4908-AC7C-00F695A62845","childFalseId":"4BD9D7AD-9075-42E4-B989-FDC9BBEC64E3"},{"id":"BFEE9A23-30A2-48AF-A6E7-AD4FDA547B5B","type":"EndpointBlock","disabled":false,"name":"rawAPIRequest","displayName":"Qlik Cloud Services - Raw API Request","comment":"Find the last reload record for this app","childId":"3267E38F-D1F2-47D9-ACAD-9535AF624F06","inputs":[{"id":"4add8960-2078-11ec-be2c-7fc55d771fe6","value":"reloads","type":"string","structure":[]},{"id":"3b992a40-2072-11ec-9f0e-ed01586a7e1b","value":"3ba1eed0-2072-11ec-aa67-f118ee53373a","type":"select","displayValue":"GET","structure":[]},{"id":"3b8b9090-2072-11ec-8c77-5195fbb0ca65","value":null,"type":"object","mode":"keyValue","structure":[]},{"id":"993585d0-2839-11ec-b431-df4deed6c1ae","value":[{"key":"appId","value":"{ $.appId }"},{"key":"limit","value":"1"},{"key":"log","value":"false"}],"type":"object","mode":"keyValue","structure":[]}],"settings":[{"id":"blendr_on_error","value":"stop","type":"select","structure":[]},{"id":"cache","value":"0","type":"select","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":473,"y":1486,"datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","endpoint_guid":"3b75dd80-2072-11ec-9043-3b2aff6123af","endpoint_role":"get"},{"id":"7814EAA5-161A-4A8F-9DAF-F8CE0C34DB24","type":"VariableBlock","disabled":false,"name":"appId","displayName":"Variable - appId","comment":"","childId":"C0FFCB79-C59A-4CD1-BA86-F5995F44CF8A","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":228,"y":1432,"variableGuid":"80B11E95-030C-4E90-BF75-AAF0A13DFE3D","operations":[{"id":"empty","key":"6DF478FB-2F56-4533-873C-3E3E7F65064F","name":"Empty { variable }","value":null},{"id":"set_value","key":"BE58E732-830A-4729-9755-0F84C9656778","name":"Set value of { variable }","value":"{replace: {$.loop.item}, $.prefixForChain}"}]},{"id":"93779EB1-6642-4A52-BBFB-9F05A92E01F9","type":"ShowBlock","disabled":false,"name":"output","displayName":"Output","comment":"","childId":"899CC8F3-4BA0-455E-87A4-A8FD43101F83","inputs":[{"id":"input","value":"## App Reload Chain\n\nSource app [\"{ $.rawAPIRequest2.data[0].name }\"]({ $.tenantHostname }/item/{ $.rawAPIRequest2.data[0].id }/details) reload status was \"{$.AppReloadFinished.data.status}\" in space \"[{ $.getSpace.name }]({ $.tenantHostname }/catalog?space_filter={ $.rawAPIRequest2.data[0].spaceId })\".\n\nTo add/remove apps in the reload chain which respond to the source app, update tags on the source app (use the prefix \"{ $.prefixForChain }\").\n\n| Initial app ID | Initial app name | Initial app space ID | Tagged app ID | Tagged app name | Tagged app space ID | Target app result |\n| -- | -- | -- | -- | -- | -- | -- |","type":"string","structure":[]}],"settings":[{"id":"display_mode","value":"add","type":"select","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":120,"y":1280},{"id":"9582268D-1F6F-4791-85F4-6D3AEA4A105F","type":"VariableBlock","disabled":false,"name":"reloadMessage","displayName":"Variable - reloadMessage","comment":"","childId":"649D082D-3AB3-4854-A540-FFDD1D505781","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":240,"y":5600,"variableGuid":"F3EC6156-449E-4809-9397-0F75EDD4F583","operations":[{"id":"set_value","key":"FCE6032E-1A3A-4519-822C-AEB699AD2D4A","name":"Set value of { variable }","value":"Found {$.iter} ({ $.iterReloadsTriggered } triggered, { $.iterReloadsSkipped } skipped, { $.iterReloadsFailed } failed) from \"{$.AppReloadFinished.data.name}\""}]},{"id":"6541DE19-BE31-4A68-90E5-A75F490BE606","type":"IfElseBlock","disabled":false,"name":"condition3","displayName":"Condition 3","comment":"Was reload queued successfully?","childId":"6FFA9A5C-90F0-4FB0-ABF0-A3022296A1EB","inputs":[{"id":"conditions","value":{"mode":"all","conditions":[{"input1":"{$.DoReload.status}","input2":"QUEUED","operator":"="}]},"type":"custom","structure":[]}],"settings":[],"collapsed":[{"name":"both","isCollapsed":false},{"name":"yes","isCollapsed":false},{"name":"no","isCollapsed":false}],"x":480,"y":2260,"childTrueId":"8A3E493F-06D3-46CA-9960-79060CB9B4E6","childFalseId":"908223AB-7D8E-4BB8-8AB1-BDCBCC836236"},{"id":"8A3E493F-06D3-46CA-9960-79060CB9B4E6","type":"VariableBlock","disabled":false,"name":"iterReloadsTriggered","displayName":"Variable - iterReloadsTriggered","comment":"","childId":null,"inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":480,"y":2140,"variableGuid":"692444FC-47A7-4808-9FE3-3240D8142DE1","operations":[{"id":"add","key":"6CE46F3B-F418-4A41-97FD-00DD5FA7FB29","name":"Add to { variable }","value":"1"}]},{"id":"908223AB-7D8E-4BB8-8AB1-BDCBCC836236","type":"VariableBlock","disabled":false,"name":"iterReloadsFailed","displayName":"Variable - iterReloadsFailed","comment":"","childId":null,"inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":600,"y":2620,"variableGuid":"7F5E536A-0F92-4C59-880A-FC49F980FFF3","operations":[{"id":"add","key":"6CE46F3B-F418-4A41-97FD-00DD5FA7FB29","name":"Add to { variable }","value":"1"}]},{"id":"3267E38F-D1F2-47D9-ACAD-9535AF624F06","type":"EndpointBlock","disabled":false,"name":"rawAPIRequest3","displayName":"Qlik Cloud Services - Raw API Request 3","comment":"Retrieve the app information by fetching the item (we also want tags)","childId":"038C6BD5-BC4A-4A38-895F-BC1642D8EE35","inputs":[{"id":"4add8960-2078-11ec-be2c-7fc55d771fe6","value":"items","type":"string","structure":[]},{"id":"3b992a40-2072-11ec-9f0e-ed01586a7e1b","value":"3ba1eed0-2072-11ec-aa67-f118ee53373a","type":"select","displayValue":"GET","structure":[]},{"id":"3b8b9090-2072-11ec-8c77-5195fbb0ca65","value":[],"type":"object","mode":"keyValue","structure":[]},{"id":"993585d0-2839-11ec-b431-df4deed6c1ae","value":[{"key":"resourceId","value":"{$.appId}"},{"key":"resourceType","value":"app"}],"type":"object","mode":"keyValue","structure":[]}],"settings":[{"id":"blendr_on_error","value":"warning","type":"select","displayValue":"Warning - Continue Automation and report errors","structure":[]},{"id":"cache","value":"0","type":"select","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":584,"y":1333,"datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","endpoint_guid":"3b75dd80-2072-11ec-9043-3b2aff6123af","endpoint_role":"get"},{"id":"CE54D05C-9720-4CC3-9D7E-9E71C9F06E5C","type":"IfElseBlock","disabled":false,"name":"condition4","displayName":"Condition 4","comment":"If reloads tags were found","childId":null,"inputs":[{"id":"conditions","value":{"mode":"all","conditions":[{"input1":"{$.iter}","input2":"0","operator":">"}]},"type":"custom","structure":[]}],"settings":[],"collapsed":[{"name":"both","isCollapsed":false},{"name":"yes","isCollapsed":false},{"name":"no","isCollapsed":false}],"x":-420,"y":4416,"childTrueId":"A39D7014-BC80-4845-9C10-5693E6B443AE","childFalseId":"9582268D-1F6F-4791-85F4-6D3AEA4A105F"},{"id":"337C4378-1069-4FC1-983C-4CA06C1A23C2","type":"ShowBlock","disabled":false,"name":"output4","displayName":"Output 4","comment":"","childId":null,"inputs":[{"id":"input","value":"| [{ $.rawAPIRequest2.data[0].resourceId }]({ $.tenantHostname }/item/{ $.rawAPIRequest2.data[0].id }/details) | { $.rawAPIRequest2.data[0].name } | [{ $.getSpace.name }]({ $.tenantHostname }/catalog?space_filter={ $.rawAPIRequest2.data[0].spaceId }) | [{ $.appId }]({ $.tenantHostname }/item/{ $.rawAPIRequest3.data[0].id }/details) | {$.rawAPIRequest3.data[0].name} | [{ $.getSpace2.name }]({ $.tenantHostname }/catalog?space_filter={ $.rawAPIRequest3.data[0].spaceId }) | [Skipped as last reload record { $.rawAPIRequest.data[0].status }]({ $.tenantHostname }/item/{ $.rawAPIRequest3.data[0].id }/history) |","type":"string","structure":[]}],"settings":[{"id":"display_mode","value":"add","type":"select","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":519,"y":3520},{"id":"649D082D-3AB3-4854-A540-FFDD1D505781","type":"ShowBlock","disabled":false,"name":"output5","displayName":"Output 5","comment":"","childId":"B4020007-17AB-439A-AFCD-E353DAC62155","inputs":[{"id":"input","value":"{ $.reloadMessage }","type":"string","structure":[]}],"settings":[{"id":"display_mode","value":"add","type":"select","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-360,"y":3493},{"id":"B4020007-17AB-439A-AFCD-E353DAC62155","type":"UpdateJobBlock","disabled":false,"name":"updateRunTitle","displayName":"Update Run Title","comment":"","childId":null,"inputs":[{"id":"title","value":"{$.reloadMessage}","type":"string","structure":[]}],"settings":[{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-393,"y":3511},{"id":"A39D7014-BC80-4845-9C10-5693E6B443AE","type":"VariableBlock","disabled":false,"name":"reloadMessage","displayName":"Variable - reloadMessage","comment":"","childId":"75800AF5-8F12-49EE-AF36-15943CFB163D","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":464,"y":3591,"variableGuid":"F3EC6156-449E-4809-9397-0F75EDD4F583","operations":[{"id":"set_value","key":"FCE6032E-1A3A-4519-822C-AEB699AD2D4A","name":"Set value of { variable }","value":"Found {$.iter} ({ $.iterReloadsTriggered } triggered, { $.iterReloadsSkipped } skipped, { $.iterReloadsFailed } failed) from \"{$.AppReloadFinished.data.name}\""}]},{"id":"75800AF5-8F12-49EE-AF36-15943CFB163D","type":"ShowBlock","disabled":false,"name":"output7","displayName":"Output 7","comment":"","childId":"6E78591E-1B26-43E8-BF4E-954518EB66B5","inputs":[{"id":"input","value":"{ $.reloadMessage }","type":"string","structure":[]}],"settings":[{"id":"display_mode","value":"add","type":"select","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-360,"y":3493},{"id":"6E78591E-1B26-43E8-BF4E-954518EB66B5","type":"UpdateJobBlock","disabled":false,"name":"updateRunTitle2","displayName":"Update Run Title 2","comment":"","childId":null,"inputs":[{"id":"title","value":"{$.reloadMessage}","type":"string","structure":[]}],"settings":[{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-393,"y":3511},{"id":"80867E87-157F-4904-9683-B714D04D5F67","type":"IfElseBlock","disabled":false,"name":"condition5","displayName":"Condition 5","comment":"If app is found","childId":null,"inputs":[{"id":"conditions","value":{"mode":"some","conditions":[{"input1":"{count: {$.rawAPIRequest3.data}}","input2":"1","operator":"="}]},"type":"custom","structure":[]}],"settings":[],"collapsed":[{"name":"both","isCollapsed":false},{"name":"yes","isCollapsed":false},{"name":"no","isCollapsed":false}],"x":751,"y":3592,"childTrueId":"97AD1046-86ED-4C14-AF68-9282A68F43E2","childFalseId":"138CFCDB-6D61-452B-A04F-C35A7A6D3589"},{"id":"138CFCDB-6D61-452B-A04F-C35A7A6D3589","type":"VariableBlock","disabled":false,"name":"iterReloadsFailed","displayName":"Variable - iterReloadsFailed","comment":"","childId":"BD4DCF17-EF5E-446E-91CD-C3AC901CC795","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":847,"y":3210,"variableGuid":"7F5E536A-0F92-4C59-880A-FC49F980FFF3","operations":[{"id":"add","key":"6CE46F3B-F418-4A41-97FD-00DD5FA7FB29","name":"Add to { variable }","value":"1"}]},{"id":"BD4DCF17-EF5E-446E-91CD-C3AC901CC795","type":"ShowBlock","disabled":false,"name":"output8","displayName":"Output 8","comment":"","childId":null,"inputs":[{"id":"input","value":"| [{ $.rawAPIRequest2.data[0].resourceId }]({ $.tenantHostname }/item/{ $.rawAPIRequest2.data[0].id }/details) | { $.rawAPIRequest2.data[0].name } | [{ $.getSpace.name }]({ $.tenantHostname }/catalog?space_filter={ $.rawAPIRequest2.data[0].spaceId }) | { $.appId } | Not found | Not found | App not found |","type":"string","structure":[]}],"settings":[{"id":"display_mode","value":"add","type":"select","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":850,"y":2860},{"id":"C0FFCB79-C59A-4CD1-BA86-F5995F44CF8A","type":"VariableBlock","disabled":false,"name":"iter","displayName":"Variable - iter","comment":"","childId":"BFEE9A23-30A2-48AF-A6E7-AD4FDA547B5B","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":730,"y":2020,"variableGuid":"C9D9B5AF-5529-4D6A-AA0A-82C12E09013B","operations":[{"id":"add","key":"6CE46F3B-F418-4A41-97FD-00DD5FA7FB29","name":"Add to { variable }","value":"1"}]},{"id":"4BD9D7AD-9075-42E4-B989-FDC9BBEC64E3","type":"VariableBlock","disabled":false,"name":"iterReloadsSkipped","displayName":"Variable - iterReloadsSkipped","comment":"","childId":"337C4378-1069-4FC1-983C-4CA06C1A23C2","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":850,"y":2620,"variableGuid":"3A176EAC-D8A6-4C83-93C5-9B58D651FFD4","operations":[{"id":"add","key":"6CE46F3B-F418-4A41-97FD-00DD5FA7FB29","name":"Add to { variable }","value":"1"}]},{"id":"6692F62D-AC8F-4CF8-BA65-659F6E3D0AAC","type":"VariableBlock","disabled":false,"name":"iterReloadsSkipped","displayName":"Variable - iterReloadsSkipped","comment":"","childId":"1CEC28C3-29F4-40B4-BAD9-D4BD8B53126F","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":250,"y":840,"variableGuid":"3A176EAC-D8A6-4C83-93C5-9B58D651FFD4","operations":[{"id":"set_value","key":"80E494BA-2524-4F17-9DFF-858D6AC91EC4","name":"Set value of { variable }","value":"0"}]},{"id":"1CA798A9-F8BC-44CC-8CE9-621780876323","type":"EndpointBlock","disabled":false,"name":"getCurrentTenantInfo","displayName":"Qlik Cloud Services - Get Current Tenant Info","comment":"Get tenant hostname for use in the output blocks","childId":"73927CE8-3EFF-4DE1-AC86-DCE0F8A25A33","inputs":[],"settings":[{"id":"blendr_on_error","value":"stop","type":"select","structure":[]},{"id":"cache","value":"0","type":"select","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-367,"y":270,"datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","endpoint_guid":"55051480-cb86-11ec-b746-892c1d04114e","endpoint_role":"get"},{"id":"73927CE8-3EFF-4DE1-AC86-DCE0F8A25A33","type":"VariableBlock","disabled":false,"name":"tenantHostname","displayName":"Variable - tenantHostname","comment":"","childId":"BF0D6CFE-D990-4BEF-AE72-FABC0AFFF269","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-570,"y":329,"variableGuid":"3B90860F-8E98-4896-B98D-4A38BFCF5EE2","operations":[{"id":"set_value","key":"98A567AC-27C8-49E4-9C54-FC30E3666BC8","name":"Set value of { variable }","value":"https://{ if: { $.getCurrentTenantInfo.hostnames[1] } empty , $.getCurrentTenantInfo.hostnames[0], $.getCurrentTenantInfo.hostnames[1] }"}]},{"id":"42CDA414-766D-464C-A7E6-368CB0EB6187","type":"EndpointBlock","disabled":false,"name":"getSpace","displayName":"Qlik Cloud Services - Get Space","comment":"","childId":"403EBAAA-FD7B-4B91-A208-B0BD2AE1D8A4","inputs":[{"id":"92f7bcd0-6d2d-11eb-9088-69419de8f253","value":"{ $.rawAPIRequest2.data[0].spaceId }","type":"string","structure":[]}],"settings":[{"id":"blendr_on_error","value":"warning","type":"select","displayValue":"Warning - Continue Automation and report errors","structure":[]},{"id":"cache","value":"0","type":"select","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-545,"y":458,"datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","endpoint_guid":"92afefd0-6d2d-11eb-aee2-055653605a8e","endpoint_role":"get"},{"id":"038C6BD5-BC4A-4A38-895F-BC1642D8EE35","type":"EndpointBlock","disabled":false,"name":"getSpace2","displayName":"Qlik Cloud Services - Get Space 2","comment":"","childId":"B564E5A7-DD82-402F-8D3F-74BADCC4736C","inputs":[{"id":"92f7bcd0-6d2d-11eb-9088-69419de8f253","value":"{ $.rawAPIRequest3.data[0].spaceId }","type":"string","structure":[]}],"settings":[{"id":"blendr_on_error","value":"warning","type":"select","displayValue":"Warning - Continue Automation and report errors","structure":[]},{"id":"cache","value":"0","type":"select","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":911,"y":2973,"datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","endpoint_guid":"92afefd0-6d2d-11eb-aee2-055653605a8e","endpoint_role":"get"},{"id":"815E4CD6-74EA-41F1-8988-424CA2829CE5","type":"VariableBlock","disabled":false,"name":"onlyManagedSpaces","displayName":"Variable - onlyManagedSpaces","comment":"Set to 1 to only run triggers when the source app is in a managed space","childId":"1CA798A9-F8BC-44CC-8CE9-621780876323","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":0,"y":480,"variableGuid":"35F9ACB6-FCBD-42C0-A6CB-D45C2B409E3E","operations":[{"id":"set_value","key":"9BC74434-9E9E-4FCD-A242-FC165AA55CB7","name":"Set value of { variable }","value":"0"}]},{"id":"403EBAAA-FD7B-4B91-A208-B0BD2AE1D8A4","type":"IfElseBlock","disabled":false,"name":"condition7","displayName":"Condition 7","comment":"App is in a managed space, or we're allowing apps from anywhere.\nAlso filter for weird situations where the app no longer exists.","childId":null,"inputs":[{"id":"conditions","value":{"mode":"all","conditions":[{"input1":"{count: {$.rawAPIRequest2.data}}","input2":"1","operator":"="},{"input1":"{if: {$.onlyManagedSpaces} = 1, $.getSpace.type, 'managed'}","input2":"managed","operator":"="}]},"type":"custom","structure":[]}],"settings":[],"collapsed":[{"name":"both","isCollapsed":false},{"name":"yes","isCollapsed":false},{"name":"no","isCollapsed":false}],"x":298,"y":947,"childTrueId":"93779EB1-6642-4A52-BBFB-9F05A92E01F9","childFalseId":"9737A769-D56C-4FA3-9EE7-84CDC01D0A58"},{"id":"9737A769-D56C-4FA3-9EE7-84CDC01D0A58","type":"VariableBlock","disabled":false,"name":"reloadMessage","displayName":"Variable - reloadMessage","comment":"","childId":"EBAB6637-305F-40B2-9584-A8C358C0FEEF","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":322,"y":5998,"variableGuid":"F3EC6156-449E-4809-9397-0F75EDD4F583","operations":[{"id":"set_value","key":"FCE6032E-1A3A-4519-822C-AEB699AD2D4A","name":"Set value of { variable }","value":"Skipped, app \"{$.AppReloadFinished.data.name}\" ({$.AppReloadFinished.extensions.topLevelResourceId}) not in managed space, or unavailable."}]},{"id":"EBAB6637-305F-40B2-9584-A8C358C0FEEF","type":"ShowBlock","disabled":false,"name":"output6","displayName":"Output 6","comment":"","childId":"C740516D-F42F-42A1-A778-2F027D89021D","inputs":[{"id":"input","value":"{ $.reloadMessage }","type":"string","structure":[]}],"settings":[{"id":"display_mode","value":"add","type":"select","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-360,"y":3493},{"id":"C740516D-F42F-42A1-A778-2F027D89021D","type":"UpdateJobBlock","disabled":false,"name":"updateRunTitle3","displayName":"Update Run Title 3","comment":"","childId":null,"inputs":[{"id":"title","value":"{$.reloadMessage}","type":"string","structure":[]}],"settings":[{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-393,"y":3511},{"id":"65751E0D-3FA8-4908-AC7C-00F695A62845","type":"IfElseBlock","disabled":false,"name":"condition6","displayName":"Condition 6","comment":"If minimum elapsed time since last reload completed or no prior reload","childId":null,"inputs":[{"id":"conditions","value":{"mode":"some","conditions":[{"input1":"{$.rawAPIRequest.data[0].endTime}","input2":null,"operator":"empty"},{"input1":"{divide: {$.secondsSinceLastReload}, 60}","input2":"{$.defaultTolerance}","operator":">="}]},"type":"custom","structure":[]}],"settings":[],"collapsed":[{"name":"both","isCollapsed":false},{"name":"yes","isCollapsed":false},{"name":"no","isCollapsed":false}],"x":-200,"y":2773,"childTrueId":"0983FEAC-2E88-4BCC-A0E0-954D6152FF66","childFalseId":"EF06D807-1D8A-4C21-9277-9539D861C576"},{"id":"43331262-2DD2-40E1-AB1F-974B19A0399E","type":"VariableBlock","disabled":false,"name":"secondsSinceLastReload","displayName":"Variable - secondsSinceLastReload","comment":"","childId":"80867E87-157F-4904-9683-B714D04D5F67","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":360,"y":2540,"variableGuid":"55ADAF58-B67B-44D1-8F5C-11108AA3FE1C","operations":[{"id":"set_value","key":"43077B44-3BAD-4CAF-AA49-52BD99DD9DAF","name":"Set value of { variable }","value":"{ converttimezone: 'now', , 'Etc/UTC', 'U', 'Etc/UTC' }"},{"id":"subtract","key":"7B5A14B7-B98F-4384-BD68-95A41B5B6B45","name":"subtract from { variable }","value":"{converttimezone: {substr: {$.rawAPIRequest.data[0].endTime}, 0, { strpos: {$.rawAPIRequest.data[0].endTime}, 'T' }}.{substr: {$.rawAPIRequest.data[0].endTime}, { add: {strpos: {$.rawAPIRequest.data[0].endTime}, 'T'}, 1 }, { subtract: {subtract: {strpos: {$.rawAPIRequest.data[0].endTime}, 'Z' }, {strpos: {$.rawAPIRequest.data[0].endTime}, 'T' }}, 1 }}, 'Y-m-d.H:i:s.v', 'Etc/UTC', 'U', 'Etc/UTC'}"}]},{"id":"EF06D807-1D8A-4C21-9277-9539D861C576","type":"VariableBlock","disabled":false,"name":"iterReloadsSkipped","displayName":"Variable - iterReloadsSkipped","comment":"","childId":"A40F4277-C504-4D08-8C5D-18EE136C847D","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":901,"y":3560,"variableGuid":"3A176EAC-D8A6-4C83-93C5-9B58D651FFD4","operations":[{"id":"add","key":"6CE46F3B-F418-4A41-97FD-00DD5FA7FB29","name":"Add to { variable }","value":"1"}]},{"id":"A40F4277-C504-4D08-8C5D-18EE136C847D","type":"ShowBlock","disabled":false,"name":"output9","displayName":"Output 9","comment":"","childId":null,"inputs":[{"id":"input","value":"| [{$.rawAPIRequest2.data[0].resourceId}]({$.tenantHostname}/item/{$.rawAPIRequest2.data[0].id}/details) | {$.rawAPIRequest2.data[0].name} | [{$.getSpace.name}]({$.tenantHostname}/catalog?space_filter={$.rawAPIRequest2.data[0].spaceId}) | [{$.appId}]({$.tenantHostname}/item/{$.rawAPIRequest3.data[0].id}/details) | {$.rawAPIRequest3.data[0].name} | [{$.getSpace2.name}]({$.tenantHostname}/catalog?space_filter={$.rawAPIRequest3.data[0].spaceId}) | [Skipped as last reload record {$.rawAPIRequest.data[0].status} found { $.secondsSinceLastReload } seconds ago, which is less than the minimum {$.defaultTolerance} minutes ago]({$.tenantHostname}/item/{$.rawAPIRequest3.data[0].id}/history) |","type":"string","structure":[]}],"settings":[{"id":"display_mode","value":"add","type":"select","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":519,"y":3520},{"id":"B6AACF94-D43C-4DC7-AAAB-FE65C57409D2","type":"VariableBlock","disabled":false,"name":"autoResolveAccessIssues","displayName":"Variable - autoResolveAccessIssues","comment":"To automatically attempt to provide the current user with access to resources for the reload, set to 1","childId":"1452553A-8444-4BCD-9C4C-2DCCD0108E0D","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":250,"y":120,"variableGuid":"0F4979FC-FF2B-4A50-BBC8-471BA750A9BC","operations":[{"id":"set_value","key":"7DF50A3F-4FA3-49AB-9D73-BC715139150E","name":"Set value of { variable }","value":"1"}]},{"id":"B564E5A7-DD82-402F-8D3F-74BADCC4736C","type":"IfElseBlock","disabled":false,"name":"condition8","displayName":"Condition 8","comment":"If no reload permission on object, and add role set to 1","childId":"43331262-2DD2-40E1-AB1F-974B19A0399E","inputs":[{"id":"conditions","value":{"mode":"all","conditions":[{"input1":"{$.autoResolveAccessIssues}","input2":"1","operator":"="},{"input1":"{$.rawAPIRequest3.data[*].actions}","input2":"reload","operator":"doesntContain"},{"input1":"{count: {$.rawAPIRequest3.data}}","input2":"1","operator":"="}]},"type":"custom","structure":[]}],"settings":[],"collapsed":[{"name":"both","isCollapsed":false},{"name":"yes","isCollapsed":false},{"name":"no","isCollapsed":false}],"x":-333,"y":2248,"childTrueId":"549D8EA3-0F53-4D1F-99AD-96E3AFD0C95F","childFalseId":null},{"id":"549D8EA3-0F53-4D1F-99AD-96E3AFD0C95F","type":"EndpointBlock","disabled":false,"name":"getCurrentUserId","displayName":"Qlik Cloud Services - Get Current User Id","comment":"","childId":"B37BFDA2-7F33-4D3B-AA19-F97FE66B5C50","inputs":[],"settings":[{"id":"blendr_on_error","value":"stop","type":"select","structure":[]},{"id":"cache","value":"0","type":"select","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-284,"y":2126,"datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","endpoint_guid":"6e9dbaa0-c7a4-11ea-9bd3-0da55b4cbed9","endpoint_role":"get"},{"id":"B37BFDA2-7F33-4D3B-AA19-F97FE66B5C50","type":"EndpointBlock","disabled":false,"name":"listMembersFromSpace","displayName":"Qlik Cloud Services - List Members From Space","comment":"","childId":"1F94FE3A-CBBD-4953-9AEB-7705D6A698B3","inputs":[{"id":"358ee8a0-6d34-11eb-b1f3-91a0d7274b22","value":"{$.rawAPIRequest3.data[0].spaceId}","type":"string","structure":[]}],"settings":[{"id":"maxitemcount","value":"","type":"string","structure":[]},{"id":"blendr_on_error","value":"stop","type":"select","structure":[]},{"id":"cache","value":"0","type":"select","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":true}],"x":-272,"y":2238,"loopBlockId":null,"datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","endpoint_guid":"ffe6d930-6d33-11eb-ad8a-334e25c5e295","endpoint_role":"list"},{"id":"8C33578B-F147-409E-B199-1437FD8FED31","type":"IfElseBlock","disabled":false,"name":"condition9","displayName":"Condition 9","comment":"If a result is found update it by assigning everything available","childId":null,"inputs":[{"id":"conditions","value":{"mode":"all","conditions":[{"input1":"{count: {$.filterList}}","input2":"1","operator":"="}]},"type":"custom","structure":[]}],"settings":[],"collapsed":[{"name":"both","isCollapsed":false},{"name":"yes","isCollapsed":false},{"name":"no","isCollapsed":false}],"x":600,"y":2840,"childTrueId":"C451A587-BD5D-4A96-A7AD-69355579E47C","childFalseId":"F455C0F7-F92B-441C-9400-E46F3562148E"},{"id":"1F94FE3A-CBBD-4953-9AEB-7705D6A698B3","type":"FilterListBlock","disabled":false,"name":"filterList","displayName":"Filter over Qlik Cloud Services - List Members From Space - Filter List","comment":"","childId":"8C33578B-F147-409E-B199-1437FD8FED31","inputs":[{"id":"list","value":"{ $.listMembersFromSpace }","type":"string","structure":[]},{"id":"conditions","value":{"mode":"all","conditions":[{"input1":"id","input2":"{$.getCurrentUserId}","operator":"="},{"input1":"type","input2":"user","operator":"="}]},"type":"custom","structure":[]}],"settings":[{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":true}],"x":-291,"y":2625,"loopBlockId":null},{"id":"C451A587-BD5D-4A96-A7AD-69355579E47C","type":"EndpointBlock","disabled":false,"name":"updateRolesOfMemberFromSpace","displayName":"Qlik Cloud Services - Update Roles Of Member From Space","comment":"","childId":null,"inputs":[{"id":"8c6b43e0-6d42-11eb-85f6-917131a7d145","value":"{$.rawAPIRequest3.data[0].spaceId}","type":"string","structure":[]},{"id":"8c72c230-6d42-11eb-837d-b1e5663f20d2","value":"{$.getCurrentUserId}","type":"string","structure":[]},{"id":"01ac8e60-6d43-11eb-9d02-4d69db8c0501","value":"{json: {$.getSpace2.meta.assignableRoles}}","type":"string","structure":[]}],"settings":[{"id":"blendr_on_error","value":"stop","type":"select","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-212,"y":2900,"datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","endpoint_guid":"8c54ade0-6d42-11eb-b3a8-75befcc89b0a","endpoint_role":"update"},{"id":"F455C0F7-F92B-441C-9400-E46F3562148E","type":"EndpointBlock","disabled":false,"name":"addMemberToSpace","displayName":"Qlik Cloud Services - Add Member To Space","comment":"","childId":null,"inputs":[{"id":"3162f740-6d33-11eb-a089-71f7ccab24b9","value":"{$.rawAPIRequest3.data[0].spaceId}","type":"string","structure":[]},{"id":"27499b00-6d31-11eb-bbe5-5b3db3c974dc","value":"{$.getCurrentUserId}","type":"string","structure":[]},{"id":"2751b870-6d31-11eb-9d77-41c5fae28bc5","value":"{json: {$.getSpace2.meta.assignableRoles}}","type":"string","structure":[]},{"id":"275e2c50-6d31-11eb-8eeb-157347755492","value":"aec7c5b0-6d32-11eb-a4b2-f5e181a2c241","type":"select","displayValue":"user","structure":[]}],"settings":[{"id":"blendr_on_error","value":"stop","type":"select","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-231,"y":2739,"datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","endpoint_guid":"272d9c70-6d31-11eb-870f-67624392ed86","endpoint_role":"create"}],"variables":[{"guid":"D8332648-F08B-4584-BF87-34ED2964F523","name":"prefixForChain","type":"string"},{"guid":"6FF47268-DA75-48B7-90CC-0DEE013758E4","name":"defaultTolerance","type":"number"},{"guid":"C9D9B5AF-5529-4D6A-AA0A-82C12E09013B","name":"iter","type":"number"},{"guid":"F3EC6156-449E-4809-9397-0F75EDD4F583","name":"reloadMessage","type":"string"},{"guid":"692444FC-47A7-4808-9FE3-3240D8142DE1","name":"iterReloadsTriggered","type":"number"},{"guid":"7F5E536A-0F92-4C59-880A-FC49F980FFF3","name":"iterReloadsFailed","type":"number"},{"guid":"80B11E95-030C-4E90-BF75-AAF0A13DFE3D","name":"appId","type":"string"},{"guid":"3A176EAC-D8A6-4C83-93C5-9B58D651FFD4","name":"iterReloadsSkipped","type":"number"},{"guid":"3B90860F-8E98-4896-B98D-4A38BFCF5EE2","name":"tenantHostname","type":"string"},{"guid":"35F9ACB6-FCBD-42C0-A6CB-D45C2B409E3E","name":"onlyManagedSpaces","type":"number"},{"guid":"55ADAF58-B67B-44D1-8F5C-11108AA3FE1C","name":"secondsSinceLastReload","type":"number"},{"guid":"0F4979FC-FF2B-4A50-BBC8-471BA750A9BC","name":"autoResolveAccessIssues","type":"number"}]}

Full automation snippet - scheduled version

This is the scheduled version.

{"blocks":[{"id":"2A22DF92-FFB1-43D4-B90C-8A0158B03280","type":"StartBlock","disabled":false,"name":"Start","displayName":"Start","comment":"","childId":"1A6DD300-BAC9-4067-A459-47BDE9235CD3","inputs":[{"id":"run_mode","value":"scheduled","type":"select","structure":{}},{"id":"schedule_start","value":"2024-06-01 13:20:37","type":"date","structure":{}},{"id":"schedule_stoptime","value":null,"type":"date","structure":{}},{"id":"schedule_interval","value":"1800","type":"select","structure":{}},{"id":"schedule_timezone","value":"America/Chicago","type":"select","structure":{}}],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":0,"y":0},{"id":"1A6DD300-BAC9-4067-A459-47BDE9235CD3","type":"VariableBlock","disabled":false,"name":"defaultTolerance","displayName":"Variable - defaultTolerance","comment":"If an app has successfully finished a reload within this many minutes, do not reload it again","childId":"B6AACF94-D43C-4DC7-AAAB-FE65C57409D2","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":0,"y":120,"variableGuid":"6FF47268-DA75-48B7-90CC-0DEE013758E4","operations":[{"id":"set_value","key":"7DF50A3F-4FA3-49AB-9D73-BC715139150E","name":"Set value of { variable }","value":"10"}]},{"id":"1452553A-8444-4BCD-9C4C-2DCCD0108E0D","type":"VariableBlock","disabled":false,"name":"prefixForChain","displayName":"Variable - prefixForChain","comment":"Set the tag prefix for the reload chain, e.g. `next-`.","childId":"815E4CD6-74EA-41F1-8988-424CA2829CE5","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":0,"y":240,"variableGuid":"D8332648-F08B-4584-BF87-34ED2964F523","operations":[{"id":"set_value","key":"F549C126-CCD5-40E8-AC89-51A8033EA0E4","name":"Set value of { variable }","value":"next-"}]},{"id":"899CC8F3-4BA0-455E-87A4-A8FD43101F83","type":"VariableBlock","disabled":false,"name":"iter","displayName":"Variable - iter","comment":"","childId":"C81CC91D-FDCE-4452-8AD0-45873EE1C41A","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":552,"y":2950,"variableGuid":"C9D9B5AF-5529-4D6A-AA0A-82C12E09013B","operations":[{"id":"set_value","key":"EDDB12AD-2EB4-4CEE-B376-E80FB3F5EBFB","name":"Set value of { variable }","value":"0"}]},{"id":"C81CC91D-FDCE-4452-8AD0-45873EE1C41A","type":"VariableBlock","disabled":false,"name":"iterReloadsTriggered","displayName":"Variable - iterReloadsTriggered","comment":"","childId":"6692F62D-AC8F-4CF8-BA65-659F6E3D0AAC","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":0,"y":840,"variableGuid":"692444FC-47A7-4808-9FE3-3240D8142DE1","operations":[{"id":"set_value","key":"80E494BA-2524-4F17-9DFF-858D6AC91EC4","name":"Set value of { variable }","value":"0"}]},{"id":"6FFA9A5C-90F0-4FB0-ABF0-A3022296A1EB","type":"ShowBlock","disabled":false,"name":"output2","displayName":"Output 2","comment":"","childId":null,"inputs":[{"id":"input","value":"| [{ $.rawAPIRequest2.data[0].resourceId }]({ $.tenantHostname }/item/{ $.rawAPIRequest2.data[0].id }/details) | { $.rawAPIRequest2.data[0].name } | [{ $.getSpace.name }]({ $.tenantHostname }/catalog?space_filter={ $.rawAPIRequest2.data[0].spaceId }) | [{ $.appId }]({ $.tenantHostname }/item/{ $.rawAPIRequest3.data[0].id }/details) | {$.rawAPIRequest3.data[0].name} | [{ $.getSpace2.name }]({ $.tenantHostname }/catalog?space_filter={ $.rawAPIRequest3.data[0].spaceId }) | [{ $.DoReload.status }]({ $.tenantHostname }/item/{ $.rawAPIRequest3.data[0].id }/history) |","type":"string","structure":[]}],"settings":[{"id":"display_mode","value":"add","type":"select","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":720,"y":3260},{"id":"BF0D6CFE-D990-4BEF-AE72-FABC0AFFF269","type":"EndpointBlock","disabled":false,"name":"rawAPIRequest2","displayName":"Qlik Cloud Services - Raw API Request 2","comment":"Retrieve the tags from the app by fetching the item","childId":"42CDA414-766D-464C-A7E6-368CB0EB6187","inputs":[{"id":"4add8960-2078-11ec-be2c-7fc55d771fe6","value":"items","type":"string","structure":[]},{"id":"3b992a40-2072-11ec-9f0e-ed01586a7e1b","value":"3ba1eed0-2072-11ec-aa67-f118ee53373a","type":"select","displayValue":"GET","structure":[]},{"id":"3b8b9090-2072-11ec-8c77-5195fbb0ca65","value":[],"type":"object","mode":"keyValue","structure":[]},{"id":"993585d0-2839-11ec-b431-df4deed6c1ae","value":[{"key":"resourceId","value":"{$.loop2.item.id}"},{"key":"resourceType","value":"app"}],"type":"object","mode":"keyValue","structure":[]}],"settings":[{"id":"blendr_on_error","value":"stop","type":"select","structure":[]},{"id":"cache","value":"0","type":"select","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":422,"y":2873,"datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","endpoint_guid":"3b75dd80-2072-11ec-9043-3b2aff6123af","endpoint_role":"get"},{"id":"1CEC28C3-29F4-40B4-BAD9-D4BD8B53126F","type":"VariableBlock","disabled":false,"name":"iterReloadsFailed","displayName":"Variable - iterReloadsFailed","comment":"","childId":"0E46CB78-DA82-4C4B-9015-8199B9D48D5E","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":0,"y":3200,"variableGuid":"7F5E536A-0F92-4C59-880A-FC49F980FFF3","operations":[{"id":"set_value","key":"80E494BA-2524-4F17-9DFF-858D6AC91EC4","name":"Set value of { variable }","value":"0"}]},{"id":"0BCE4F6C-34CA-499D-A14B-20CF4F978674","type":"ForEachBlock","disabled":false,"name":"loop","displayName":"Loop","comment":"Filter down tags to those which begin with prefix by looping over tags. There will only be one resource returned each request due to the GUID.","childId":null,"inputs":[{"id":"input","value":"{ $.rawAPIRequest2.data[0].meta.tags[*].name }","type":"string","structure":[]}],"settings":[{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":570,"y":3769,"loopBlockId":"D4B85F3D-5262-4113-92A3-631369AE97C5"},{"id":"D4B85F3D-5262-4113-92A3-631369AE97C5","type":"IfElseBlock","disabled":false,"name":"condition","displayName":"Condition","comment":"If tag contains prefix","childId":null,"inputs":[{"id":"conditions","value":{"mode":"all","conditions":[{"input1":"{$.loop.item}","input2":"{$.prefixForChain}","operator":"contain"}]},"type":"custom","structure":[]}],"settings":[],"collapsed":[{"name":"both","isCollapsed":false},{"name":"yes","isCollapsed":false},{"name":"no","isCollapsed":false}],"x":228,"y":1552,"childTrueId":"7814EAA5-161A-4A8F-9DAF-F8CE0C34DB24","childFalseId":null},{"id":"0983FEAC-2E88-4BCC-A0E0-954D6152FF66","type":"SnippetBlock","disabled":false,"name":"DoReload","displayName":"Qlik Cloud Services - Do Reload","comment":"Attempt the reload","childId":"6541DE19-BE31-4A68-90E5-A75F490BE606","inputs":[{"id":"29603390-e716-11ea-9e37-05e08ee32111","value":"{ $.appId }","type":"string","structure":[]},{"id":"2ac9eef0-a677-11eb-aacc-8b755d0fe484","value":"Start reload and continue","type":"select","displayValue":"Start reload and continue","structure":[]},{"id":"6892c0c0-c795-11eb-9860-9dc8cb705e25","value":null,"type":"select","structure":[]},{"id":"ecebf340-c797-11eb-8671-53658babb1a1","value":null,"type":"select","structure":[]}],"settings":[{"id":"blendr_on_error","value":"warning","type":"select","displayValue":"Warning - Continue Automation and report errors","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":600,"y":3060,"datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","snippet_guid":"b5dbb7a0-e715-11ea-b2bf-43bb35adee19"},{"id":"97AD1046-86ED-4C14-AF68-9282A68F43E2","type":"IfElseBlock","disabled":false,"name":"condition2","displayName":"Condition 2","comment":"If previous reload succeeded or there hasn't been a reload","childId":null,"inputs":[{"id":"conditions","value":{"mode":"some","conditions":[{"input1":"{$.rawAPIRequest.data[0].status}","input2":"SUCCEEDED","operator":"="},{"input1":"{$.rawAPIRequest.data[0].status}","input2":null,"operator":"empty"}]},"type":"custom","structure":[]}],"settings":[],"collapsed":[{"name":"both","isCollapsed":false},{"name":"yes","isCollapsed":false},{"name":"no","isCollapsed":false}],"x":240,"y":1980,"childTrueId":"65751E0D-3FA8-4908-AC7C-00F695A62845","childFalseId":"4BD9D7AD-9075-42E4-B989-FDC9BBEC64E3"},{"id":"BFEE9A23-30A2-48AF-A6E7-AD4FDA547B5B","type":"EndpointBlock","disabled":false,"name":"rawAPIRequest","displayName":"Qlik Cloud Services - Raw API Request","comment":"Find the last reload record for this app","childId":"3267E38F-D1F2-47D9-ACAD-9535AF624F06","inputs":[{"id":"4add8960-2078-11ec-be2c-7fc55d771fe6","value":"reloads","type":"string","structure":[]},{"id":"3b992a40-2072-11ec-9f0e-ed01586a7e1b","value":"3ba1eed0-2072-11ec-aa67-f118ee53373a","type":"select","displayValue":"GET","structure":[]},{"id":"3b8b9090-2072-11ec-8c77-5195fbb0ca65","value":null,"type":"object","mode":"keyValue","structure":[]},{"id":"993585d0-2839-11ec-b431-df4deed6c1ae","value":[{"key":"appId","value":"{ $.appId }"},{"key":"limit","value":"1"},{"key":"log","value":"false"}],"type":"object","mode":"keyValue","structure":[]}],"settings":[{"id":"blendr_on_error","value":"stop","type":"select","structure":[]},{"id":"cache","value":"0","type":"select","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":473,"y":1486,"datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","endpoint_guid":"3b75dd80-2072-11ec-9043-3b2aff6123af","endpoint_role":"get"},{"id":"7814EAA5-161A-4A8F-9DAF-F8CE0C34DB24","type":"VariableBlock","disabled":false,"name":"appId","displayName":"Variable - appId","comment":"","childId":"C0FFCB79-C59A-4CD1-BA86-F5995F44CF8A","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":228,"y":1432,"variableGuid":"80B11E95-030C-4E90-BF75-AAF0A13DFE3D","operations":[{"id":"empty","key":"6DF478FB-2F56-4533-873C-3E3E7F65064F","name":"Empty { variable }","value":null},{"id":"set_value","key":"BE58E732-830A-4729-9755-0F84C9656778","name":"Set value of { variable }","value":"{replace: {$.loop.item}, $.prefixForChain}"}]},{"id":"9582268D-1F6F-4791-85F4-6D3AEA4A105F","type":"VariableBlock","disabled":false,"name":"reloadMessage","displayName":"Variable - reloadMessage","comment":"","childId":"649D082D-3AB3-4854-A540-FFDD1D505781","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":240,"y":5600,"variableGuid":"F3EC6156-449E-4809-9397-0F75EDD4F583","operations":[{"id":"set_value","key":"FCE6032E-1A3A-4519-822C-AEB699AD2D4A","name":"Set value of { variable }","value":"Found {$.iter} ({$.iterReloadsTriggered} triggered, {$.iterReloadsSkipped} skipped, {$.iterReloadsFailed} failed) from {$.appCount} source apps ({ $.iterAppSkipped } apps skipped)."}]},{"id":"6541DE19-BE31-4A68-90E5-A75F490BE606","type":"IfElseBlock","disabled":false,"name":"condition3","displayName":"Condition 3","comment":"Was reload queued successfully?","childId":"6FFA9A5C-90F0-4FB0-ABF0-A3022296A1EB","inputs":[{"id":"conditions","value":{"mode":"all","conditions":[{"input1":"{$.DoReload.status}","input2":"QUEUED","operator":"="}]},"type":"custom","structure":[]}],"settings":[],"collapsed":[{"name":"both","isCollapsed":false},{"name":"yes","isCollapsed":false},{"name":"no","isCollapsed":false}],"x":480,"y":2260,"childTrueId":"8A3E493F-06D3-46CA-9960-79060CB9B4E6","childFalseId":"908223AB-7D8E-4BB8-8AB1-BDCBCC836236"},{"id":"8A3E493F-06D3-46CA-9960-79060CB9B4E6","type":"VariableBlock","disabled":false,"name":"iterReloadsTriggered","displayName":"Variable - iterReloadsTriggered","comment":"","childId":null,"inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":480,"y":2140,"variableGuid":"692444FC-47A7-4808-9FE3-3240D8142DE1","operations":[{"id":"add","key":"6CE46F3B-F418-4A41-97FD-00DD5FA7FB29","name":"Add to { variable }","value":"1"}]},{"id":"908223AB-7D8E-4BB8-8AB1-BDCBCC836236","type":"VariableBlock","disabled":false,"name":"iterReloadsFailed","displayName":"Variable - iterReloadsFailed","comment":"","childId":null,"inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":600,"y":2620,"variableGuid":"7F5E536A-0F92-4C59-880A-FC49F980FFF3","operations":[{"id":"add","key":"6CE46F3B-F418-4A41-97FD-00DD5FA7FB29","name":"Add to { variable }","value":"1"}]},{"id":"3267E38F-D1F2-47D9-ACAD-9535AF624F06","type":"EndpointBlock","disabled":false,"name":"rawAPIRequest3","displayName":"Qlik Cloud Services - Raw API Request 3","comment":"Retrieve the app information by fetching the item (we also want tags)","childId":"038C6BD5-BC4A-4A38-895F-BC1642D8EE35","inputs":[{"id":"4add8960-2078-11ec-be2c-7fc55d771fe6","value":"items","type":"string","structure":[]},{"id":"3b992a40-2072-11ec-9f0e-ed01586a7e1b","value":"3ba1eed0-2072-11ec-aa67-f118ee53373a","type":"select","displayValue":"GET","structure":[]},{"id":"3b8b9090-2072-11ec-8c77-5195fbb0ca65","value":[],"type":"object","mode":"keyValue","structure":[]},{"id":"993585d0-2839-11ec-b431-df4deed6c1ae","value":[{"key":"resourceId","value":"{$.appId}"},{"key":"resourceType","value":"app"}],"type":"object","mode":"keyValue","structure":[]}],"settings":[{"id":"blendr_on_error","value":"warning","type":"select","displayValue":"Warning - Continue Automation and report errors","structure":[]},{"id":"cache","value":"0","type":"select","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":584,"y":1333,"datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","endpoint_guid":"3b75dd80-2072-11ec-9043-3b2aff6123af","endpoint_role":"get"},{"id":"CE54D05C-9720-4CC3-9D7E-9E71C9F06E5C","type":"IfElseBlock","disabled":false,"name":"condition4","displayName":"Condition 4","comment":"If reloads tags were found","childId":null,"inputs":[{"id":"conditions","value":{"mode":"all","conditions":[{"input1":"{$.iter}","input2":"0","operator":">"}]},"type":"custom","structure":[]}],"settings":[],"collapsed":[{"name":"both","isCollapsed":false},{"name":"yes","isCollapsed":false},{"name":"no","isCollapsed":false}],"x":240,"y":7840,"childTrueId":"A39D7014-BC80-4845-9C10-5693E6B443AE","childFalseId":"9582268D-1F6F-4791-85F4-6D3AEA4A105F"},{"id":"337C4378-1069-4FC1-983C-4CA06C1A23C2","type":"ShowBlock","disabled":false,"name":"output4","displayName":"Output 4","comment":"","childId":null,"inputs":[{"id":"input","value":"| [{ $.rawAPIRequest2.data[0].resourceId }]({ $.tenantHostname }/item/{ $.rawAPIRequest2.data[0].id }/details) | { $.rawAPIRequest2.data[0].name } | [{ $.getSpace.name }]({ $.tenantHostname }/catalog?space_filter={ $.rawAPIRequest2.data[0].spaceId }) | [{ $.appId }]({ $.tenantHostname }/item/{ $.rawAPIRequest3.data[0].id }/details) | {$.rawAPIRequest3.data[0].name} | [{ $.getSpace2.name }]({ $.tenantHostname }/catalog?space_filter={ $.rawAPIRequest3.data[0].spaceId }) | [Skipped as last reload record { $.rawAPIRequest.data[0].status }]({ $.tenantHostname }/item/{ $.rawAPIRequest3.data[0].id }/history) |","type":"string","structure":[]}],"settings":[{"id":"display_mode","value":"add","type":"select","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":519,"y":3520},{"id":"649D082D-3AB3-4854-A540-FFDD1D505781","type":"ShowBlock","disabled":false,"name":"output5","displayName":"Output 5","comment":"","childId":"B4020007-17AB-439A-AFCD-E353DAC62155","inputs":[{"id":"input","value":"{ $.reloadMessage }","type":"string","structure":[]}],"settings":[{"id":"display_mode","value":"add","type":"select","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-360,"y":3493},{"id":"B4020007-17AB-439A-AFCD-E353DAC62155","type":"UpdateJobBlock","disabled":false,"name":"updateRunTitle","displayName":"Update Run Title","comment":"","childId":null,"inputs":[{"id":"title","value":"{$.reloadMessage}","type":"string","structure":[]}],"settings":[{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-393,"y":3511},{"id":"A39D7014-BC80-4845-9C10-5693E6B443AE","type":"VariableBlock","disabled":false,"name":"reloadMessage","displayName":"Variable - reloadMessage","comment":"","childId":"75800AF5-8F12-49EE-AF36-15943CFB163D","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":464,"y":3591,"variableGuid":"F3EC6156-449E-4809-9397-0F75EDD4F583","operations":[{"id":"set_value","key":"FCE6032E-1A3A-4519-822C-AEB699AD2D4A","name":"Set value of { variable }","value":"Found {$.iter} ({ $.iterReloadsTriggered } triggered, { $.iterReloadsSkipped } skipped, { $.iterReloadsFailed } failed) from {$.appCount} source apps ({ $.iterAppSkipped } apps skipped)."}]},{"id":"75800AF5-8F12-49EE-AF36-15943CFB163D","type":"ShowBlock","disabled":false,"name":"output7","displayName":"Output 7","comment":"","childId":"6E78591E-1B26-43E8-BF4E-954518EB66B5","inputs":[{"id":"input","value":"{ $.reloadMessage }","type":"string","structure":[]}],"settings":[{"id":"display_mode","value":"add","type":"select","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-360,"y":3493},{"id":"6E78591E-1B26-43E8-BF4E-954518EB66B5","type":"UpdateJobBlock","disabled":false,"name":"updateRunTitle2","displayName":"Update Run Title 2","comment":"","childId":null,"inputs":[{"id":"title","value":"{$.reloadMessage}","type":"string","structure":[]}],"settings":[{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-393,"y":3511},{"id":"80867E87-157F-4904-9683-B714D04D5F67","type":"IfElseBlock","disabled":false,"name":"condition5","displayName":"Condition 5","comment":"If app is found","childId":null,"inputs":[{"id":"conditions","value":{"mode":"some","conditions":[{"input1":"{count: {$.rawAPIRequest3.data}}","input2":"1","operator":"="}]},"type":"custom","structure":[]}],"settings":[],"collapsed":[{"name":"both","isCollapsed":false},{"name":"yes","isCollapsed":false},{"name":"no","isCollapsed":false}],"x":751,"y":3592,"childTrueId":"97AD1046-86ED-4C14-AF68-9282A68F43E2","childFalseId":"138CFCDB-6D61-452B-A04F-C35A7A6D3589"},{"id":"138CFCDB-6D61-452B-A04F-C35A7A6D3589","type":"VariableBlock","disabled":false,"name":"iterReloadsFailed","displayName":"Variable - iterReloadsFailed","comment":"","childId":"BD4DCF17-EF5E-446E-91CD-C3AC901CC795","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":847,"y":3210,"variableGuid":"7F5E536A-0F92-4C59-880A-FC49F980FFF3","operations":[{"id":"add","key":"6CE46F3B-F418-4A41-97FD-00DD5FA7FB29","name":"Add to { variable }","value":"1"}]},{"id":"BD4DCF17-EF5E-446E-91CD-C3AC901CC795","type":"ShowBlock","disabled":false,"name":"output8","displayName":"Output 8","comment":"","childId":null,"inputs":[{"id":"input","value":"| [{ $.rawAPIRequest2.data[0].resourceId }]({ $.tenantHostname }/item/{ $.rawAPIRequest2.data[0].id }/details) | { $.rawAPIRequest2.data[0].name } | [{ $.getSpace.name }]({ $.tenantHostname }/catalog?space_filter={ $.rawAPIRequest2.data[0].spaceId }) | { $.appId } | Not found | Not found | App not found |","type":"string","structure":[]}],"settings":[{"id":"display_mode","value":"add","type":"select","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":850,"y":2860},{"id":"C0FFCB79-C59A-4CD1-BA86-F5995F44CF8A","type":"VariableBlock","disabled":false,"name":"iter","displayName":"Variable - iter","comment":"","childId":"BFEE9A23-30A2-48AF-A6E7-AD4FDA547B5B","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":730,"y":2020,"variableGuid":"C9D9B5AF-5529-4D6A-AA0A-82C12E09013B","operations":[{"id":"add","key":"6CE46F3B-F418-4A41-97FD-00DD5FA7FB29","name":"Add to { variable }","value":"1"}]},{"id":"4BD9D7AD-9075-42E4-B989-FDC9BBEC64E3","type":"VariableBlock","disabled":false,"name":"iterReloadsSkipped","displayName":"Variable - iterReloadsSkipped","comment":"","childId":"337C4378-1069-4FC1-983C-4CA06C1A23C2","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":850,"y":2620,"variableGuid":"3A176EAC-D8A6-4C83-93C5-9B58D651FFD4","operations":[{"id":"add","key":"6CE46F3B-F418-4A41-97FD-00DD5FA7FB29","name":"Add to { variable }","value":"1"}]},{"id":"6692F62D-AC8F-4CF8-BA65-659F6E3D0AAC","type":"VariableBlock","disabled":false,"name":"iterReloadsSkipped","displayName":"Variable - iterReloadsSkipped","comment":"","childId":"1CEC28C3-29F4-40B4-BAD9-D4BD8B53126F","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":250,"y":840,"variableGuid":"3A176EAC-D8A6-4C83-93C5-9B58D651FFD4","operations":[{"id":"set_value","key":"80E494BA-2524-4F17-9DFF-858D6AC91EC4","name":"Set value of { variable }","value":"0"}]},{"id":"1CA798A9-F8BC-44CC-8CE9-621780876323","type":"EndpointBlock","disabled":false,"name":"getCurrentTenantInfo","displayName":"Qlik Cloud Services - Get Current Tenant Info","comment":"Get tenant hostname for use in the output blocks","childId":"73927CE8-3EFF-4DE1-AC86-DCE0F8A25A33","inputs":[],"settings":[{"id":"blendr_on_error","value":"stop","type":"select","structure":[]},{"id":"cache","value":"0","type":"select","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-367,"y":270,"datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","endpoint_guid":"55051480-cb86-11ec-b746-892c1d04114e","endpoint_role":"get"},{"id":"73927CE8-3EFF-4DE1-AC86-DCE0F8A25A33","type":"VariableBlock","disabled":false,"name":"tenantHostname","displayName":"Variable - tenantHostname","comment":"","childId":"559B40DE-CED6-4300-8B60-57CE3C6C0C44","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-570,"y":329,"variableGuid":"3B90860F-8E98-4896-B98D-4A38BFCF5EE2","operations":[{"id":"set_value","key":"98A567AC-27C8-49E4-9C54-FC30E3666BC8","name":"Set value of { variable }","value":"https://{ if: { $.getCurrentTenantInfo.hostnames[1] } empty , $.getCurrentTenantInfo.hostnames[0], $.getCurrentTenantInfo.hostnames[1] }"}]},{"id":"42CDA414-766D-464C-A7E6-368CB0EB6187","type":"EndpointBlock","disabled":false,"name":"getSpace","displayName":"Qlik Cloud Services - Get Space","comment":"","childId":"403EBAAA-FD7B-4B91-A208-B0BD2AE1D8A4","inputs":[{"id":"92f7bcd0-6d2d-11eb-9088-69419de8f253","value":"{ $.rawAPIRequest2.data[0].spaceId }","type":"string","structure":[]}],"settings":[{"id":"blendr_on_error","value":"warning","type":"select","displayValue":"Warning - Continue Automation and report errors","structure":[]},{"id":"cache","value":"0","type":"select","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-545,"y":458,"datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","endpoint_guid":"92afefd0-6d2d-11eb-aee2-055653605a8e","endpoint_role":"get"},{"id":"038C6BD5-BC4A-4A38-895F-BC1642D8EE35","type":"EndpointBlock","disabled":false,"name":"getSpace2","displayName":"Qlik Cloud Services - Get Space 2","comment":"","childId":"B564E5A7-DD82-402F-8D3F-74BADCC4736C","inputs":[{"id":"92f7bcd0-6d2d-11eb-9088-69419de8f253","value":"{ $.rawAPIRequest3.data[0].spaceId }","type":"string","structure":[]}],"settings":[{"id":"blendr_on_error","value":"warning","type":"select","displayValue":"Warning - Continue Automation and report errors","structure":[]},{"id":"cache","value":"0","type":"select","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":911,"y":2973,"datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","endpoint_guid":"92afefd0-6d2d-11eb-aee2-055653605a8e","endpoint_role":"get"},{"id":"815E4CD6-74EA-41F1-8988-424CA2829CE5","type":"VariableBlock","disabled":false,"name":"onlyManagedSpaces","displayName":"Variable - onlyManagedSpaces","comment":"Set to 1 to only run triggers when the source app is in a managed space","childId":"1CA798A9-F8BC-44CC-8CE9-621780876323","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":0,"y":480,"variableGuid":"35F9ACB6-FCBD-42C0-A6CB-D45C2B409E3E","operations":[{"id":"set_value","key":"9BC74434-9E9E-4FCD-A242-FC165AA55CB7","name":"Set value of { variable }","value":"0"}]},{"id":"403EBAAA-FD7B-4B91-A208-B0BD2AE1D8A4","type":"IfElseBlock","disabled":false,"name":"condition7","displayName":"Condition 7","comment":"App is in a managed space, or we're allowing apps from anywhere.\nAlso filter for weird situations where the app no longer exists.","childId":null,"inputs":[{"id":"conditions","value":{"mode":"all","conditions":[{"input1":"{count: {$.rawAPIRequest2.data}}","input2":"1","operator":"="},{"input1":"{if: {$.onlyManagedSpaces} = 1, $.getSpace.type, 'managed'}","input2":"managed","operator":"="}]},"type":"custom","structure":[]}],"settings":[],"collapsed":[{"name":"both","isCollapsed":false},{"name":"yes","isCollapsed":false},{"name":"no","isCollapsed":false}],"x":298,"y":947,"childTrueId":"0BCE4F6C-34CA-499D-A14B-20CF4F978674","childFalseId":"28C9DAA5-4BAB-482E-88C5-ACFA4393472B"},{"id":"65751E0D-3FA8-4908-AC7C-00F695A62845","type":"IfElseBlock","disabled":false,"name":"condition6","displayName":"Condition 6","comment":"If minimum elapsed time since last reload completed or no prior reload","childId":null,"inputs":[{"id":"conditions","value":{"mode":"some","conditions":[{"input1":"{$.rawAPIRequest.data[0].endTime}","input2":null,"operator":"empty"},{"input1":"{divide: {$.secondsSinceLastReload}, 60}","input2":"{$.defaultTolerance}","operator":">="}]},"type":"custom","structure":[]}],"settings":[],"collapsed":[{"name":"both","isCollapsed":false},{"name":"yes","isCollapsed":false},{"name":"no","isCollapsed":false}],"x":-200,"y":2773,"childTrueId":"0983FEAC-2E88-4BCC-A0E0-954D6152FF66","childFalseId":"EF06D807-1D8A-4C21-9277-9539D861C576"},{"id":"43331262-2DD2-40E1-AB1F-974B19A0399E","type":"VariableBlock","disabled":false,"name":"secondsSinceLastReload","displayName":"Variable - secondsSinceLastReload","comment":"","childId":"80867E87-157F-4904-9683-B714D04D5F67","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":360,"y":2540,"variableGuid":"55ADAF58-B67B-44D1-8F5C-11108AA3FE1C","operations":[{"id":"set_value","key":"43077B44-3BAD-4CAF-AA49-52BD99DD9DAF","name":"Set value of { variable }","value":"{ converttimezone: 'now', , 'Etc/UTC', 'U', 'Etc/UTC' }"},{"id":"subtract","key":"7B5A14B7-B98F-4384-BD68-95A41B5B6B45","name":"subtract from { variable }","value":"{converttimezone: {substr: {$.rawAPIRequest.data[0].endTime}, 0, { strpos: {$.rawAPIRequest.data[0].endTime}, 'T' }}.{substr: {$.rawAPIRequest.data[0].endTime}, { add: {strpos: {$.rawAPIRequest.data[0].endTime}, 'T'}, 1 }, { subtract: {subtract: {strpos: {$.rawAPIRequest.data[0].endTime}, 'Z' }, {strpos: {$.rawAPIRequest.data[0].endTime}, 'T' }}, 1 }}, 'Y-m-d.H:i:s.v', 'Etc/UTC', 'U', 'Etc/UTC'}"}]},{"id":"EF06D807-1D8A-4C21-9277-9539D861C576","type":"VariableBlock","disabled":false,"name":"iterReloadsSkipped","displayName":"Variable - iterReloadsSkipped","comment":"","childId":"A40F4277-C504-4D08-8C5D-18EE136C847D","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":840,"y":6640,"variableGuid":"3A176EAC-D8A6-4C83-93C5-9B58D651FFD4","operations":[{"id":"add","key":"6CE46F3B-F418-4A41-97FD-00DD5FA7FB29","name":"Add to { variable }","value":"1"}]},{"id":"A40F4277-C504-4D08-8C5D-18EE136C847D","type":"ShowBlock","disabled":false,"name":"output9","displayName":"Output 9","comment":"","childId":null,"inputs":[{"id":"input","value":"| [{$.rawAPIRequest2.data[0].resourceId}]({$.tenantHostname}/item/{$.rawAPIRequest2.data[0].id}/details) | {$.rawAPIRequest2.data[0].name} | [{$.getSpace.name}]({$.tenantHostname}/catalog?space_filter={$.rawAPIRequest2.data[0].spaceId}) | [{$.appId}]({$.tenantHostname}/item/{$.rawAPIRequest3.data[0].id}/details) | {$.rawAPIRequest3.data[0].name} | [{$.getSpace2.name}]({$.tenantHostname}/catalog?space_filter={$.rawAPIRequest3.data[0].spaceId}) | [Skipped as last reload record {$.rawAPIRequest.data[0].status} found { $.secondsSinceLastReload } seconds ago, which is less than the minimum {$.defaultTolerance} minutes ago]({$.tenantHostname}/item/{$.rawAPIRequest3.data[0].id}/history) |","type":"string","structure":[]}],"settings":[{"id":"display_mode","value":"add","type":"select","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":519,"y":3520},{"id":"B6AACF94-D43C-4DC7-AAAB-FE65C57409D2","type":"VariableBlock","disabled":false,"name":"autoResolveAccessIssues","displayName":"Variable - autoResolveAccessIssues","comment":"To automatically attempt to provide the current user with access to resources for the reload, set to 1","childId":"1452553A-8444-4BCD-9C4C-2DCCD0108E0D","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":250,"y":120,"variableGuid":"0F4979FC-FF2B-4A50-BBC8-471BA750A9BC","operations":[{"id":"set_value","key":"7DF50A3F-4FA3-49AB-9D73-BC715139150E","name":"Set value of { variable }","value":"1"}]},{"id":"B564E5A7-DD82-402F-8D3F-74BADCC4736C","type":"IfElseBlock","disabled":false,"name":"condition8","displayName":"Condition 8","comment":"If no reload permission on object, and add role set to 1","childId":"43331262-2DD2-40E1-AB1F-974B19A0399E","inputs":[{"id":"conditions","value":{"mode":"all","conditions":[{"input1":"{$.autoResolveAccessIssues}","input2":"1","operator":"="},{"input1":"{$.rawAPIRequest3.data[*].actions}","input2":"reload","operator":"doesntContain"},{"input1":"{count: {$.rawAPIRequest3.data}}","input2":"1","operator":"="}]},"type":"custom","structure":[]}],"settings":[],"collapsed":[{"name":"both","isCollapsed":false},{"name":"yes","isCollapsed":false},{"name":"no","isCollapsed":false}],"x":-333,"y":2248,"childTrueId":"549D8EA3-0F53-4D1F-99AD-96E3AFD0C95F","childFalseId":null},{"id":"549D8EA3-0F53-4D1F-99AD-96E3AFD0C95F","type":"EndpointBlock","disabled":false,"name":"getCurrentUserId","displayName":"Qlik Cloud Services - Get Current User Id","comment":"","childId":"B37BFDA2-7F33-4D3B-AA19-F97FE66B5C50","inputs":[],"settings":[{"id":"blendr_on_error","value":"stop","type":"select","structure":[]},{"id":"cache","value":"0","type":"select","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-284,"y":2126,"datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","endpoint_guid":"6e9dbaa0-c7a4-11ea-9bd3-0da55b4cbed9","endpoint_role":"get"},{"id":"B37BFDA2-7F33-4D3B-AA19-F97FE66B5C50","type":"EndpointBlock","disabled":false,"name":"listMembersFromSpace","displayName":"Qlik Cloud Services - List Members From Space","comment":"","childId":"1F94FE3A-CBBD-4953-9AEB-7705D6A698B3","inputs":[{"id":"358ee8a0-6d34-11eb-b1f3-91a0d7274b22","value":"{$.rawAPIRequest3.data[0].spaceId}","type":"string","structure":[]}],"settings":[{"id":"maxitemcount","value":"","type":"string","structure":[]},{"id":"blendr_on_error","value":"stop","type":"select","structure":[]},{"id":"cache","value":"0","type":"select","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":true}],"x":-272,"y":2238,"loopBlockId":null,"datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","endpoint_guid":"ffe6d930-6d33-11eb-ad8a-334e25c5e295","endpoint_role":"list"},{"id":"8C33578B-F147-409E-B199-1437FD8FED31","type":"IfElseBlock","disabled":false,"name":"condition9","displayName":"Condition 9","comment":"If a result is found update it by assigning everything available","childId":null,"inputs":[{"id":"conditions","value":{"mode":"all","conditions":[{"input1":"{count: {$.filterList}}","input2":"1","operator":"="}]},"type":"custom","structure":[]}],"settings":[],"collapsed":[{"name":"both","isCollapsed":false},{"name":"yes","isCollapsed":false},{"name":"no","isCollapsed":false}],"x":600,"y":2840,"childTrueId":"C451A587-BD5D-4A96-A7AD-69355579E47C","childFalseId":"F455C0F7-F92B-441C-9400-E46F3562148E"},{"id":"1F94FE3A-CBBD-4953-9AEB-7705D6A698B3","type":"FilterListBlock","disabled":false,"name":"filterList","displayName":"Filter over Qlik Cloud Services - List Members From Space - Filter List","comment":"","childId":"8C33578B-F147-409E-B199-1437FD8FED31","inputs":[{"id":"list","value":"{ $.listMembersFromSpace }","type":"string","structure":[]},{"id":"conditions","value":{"mode":"all","conditions":[{"input1":"id","input2":"{$.getCurrentUserId}","operator":"="},{"input1":"type","input2":"user","operator":"="}]},"type":"custom","structure":[]}],"settings":[{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":true}],"x":-291,"y":2625,"loopBlockId":null},{"id":"C451A587-BD5D-4A96-A7AD-69355579E47C","type":"EndpointBlock","disabled":false,"name":"updateRolesOfMemberFromSpace","displayName":"Qlik Cloud Services - Update Roles Of Member From Space","comment":"","childId":null,"inputs":[{"id":"8c6b43e0-6d42-11eb-85f6-917131a7d145","value":"{$.rawAPIRequest3.data[0].spaceId}","type":"string","structure":[]},{"id":"8c72c230-6d42-11eb-837d-b1e5663f20d2","value":"{$.getCurrentUserId}","type":"string","structure":[]},{"id":"01ac8e60-6d43-11eb-9d02-4d69db8c0501","value":"{json: {$.getSpace2.meta.assignableRoles}}","type":"string","structure":[]}],"settings":[{"id":"blendr_on_error","value":"stop","type":"select","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-212,"y":2900,"datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","endpoint_guid":"8c54ade0-6d42-11eb-b3a8-75befcc89b0a","endpoint_role":"update"},{"id":"F455C0F7-F92B-441C-9400-E46F3562148E","type":"EndpointBlock","disabled":false,"name":"addMemberToSpace","displayName":"Qlik Cloud Services - Add Member To Space","comment":"","childId":null,"inputs":[{"id":"3162f740-6d33-11eb-a089-71f7ccab24b9","value":"{$.rawAPIRequest3.data[0].spaceId}","type":"string","structure":[]},{"id":"27499b00-6d31-11eb-bbe5-5b3db3c974dc","value":"{$.getCurrentUserId}","type":"string","structure":[]},{"id":"2751b870-6d31-11eb-9d77-41c5fae28bc5","value":"{json: {$.getSpace2.meta.assignableRoles}}","type":"string","structure":[]},{"id":"275e2c50-6d31-11eb-8eeb-157347755492","value":"aec7c5b0-6d32-11eb-a4b2-f5e181a2c241","type":"select","displayValue":"user","structure":[]}],"settings":[{"id":"blendr_on_error","value":"stop","type":"select","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-231,"y":2739,"datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","endpoint_guid":"272d9c70-6d31-11eb-870f-67624392ed86","endpoint_role":"create"},{"id":"559B40DE-CED6-4300-8B60-57CE3C6C0C44","type":"VariableBlock","disabled":false,"name":"startDate","displayName":"Variable - startDate","comment":"Set a default start timestamp of now. This means no reloads will be triggered, unless this value is overwritten by a previously successful run of the automation.","childId":"D486759F-E0C9-4BD0-9D3C-7B3FE8F46DD0","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":62,"y":883,"variableGuid":"B9D27E13-C323-414F-ABDC-7D30F6320CBA","operations":[{"id":"set_value","key":"6317704E-7226-4E4A-AE32-AD050599F410","name":"Set value of { variable }","value":"{date: 'now'}"}]},{"id":"D486759F-E0C9-4BD0-9D3C-7B3FE8F46DD0","type":"EndpointBlock","disabled":false,"name":"listAutomationRuns","displayName":"Qlik Cloud Services - List Automation Runs","comment":"Retrieve previous successful run of this automation","childId":"BCAFDDD5-D854-402A-A699-8A97F0A90AA9","inputs":[{"id":"b41c66c0-cc64-11ec-9e0f-27d96671c4e5","value":"{automationid}","type":"string","structure":[]},{"id":"8a94c250-cc64-11ec-8eaa-ebb71383dd30","value":"-startTime","type":"string","structure":[]},{"id":"7d8eb800-cc65-11ec-aa62-05f2c00cdc02","value":"status eq \"finished\"","type":"string","structure":[]}],"settings":[{"id":"maxitemcount","value":"1","type":"string","structure":[]},{"id":"blendr_on_error","value":"stop","type":"select","structure":[]},{"id":"cache","value":"0","type":"select","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":500,"y":574,"loopBlockId":"8F9C4777-B9D1-4C16-9AC0-60714DF785FB","datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","endpoint_guid":"8a8097f0-cc64-11ec-9cc7-c3ac522ab035","endpoint_role":"list"},{"id":"BCAFDDD5-D854-402A-A699-8A97F0A90AA9","type":"VariableBlock","disabled":false,"name":"reloadFinishedFilter","displayName":"Variable - reloadFinishedFilter","comment":"Format the reload finished filter for QCS","childId":"C7BE63EB-FFCD-428B-9802-D9BF2E68C752","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":0,"y":1340,"variableGuid":"D3CD2E22-D4C4-488A-8465-7781F1F9C294","operations":[{"id":"set_value","key":"698154A3-8506-43FD-A291-D03A23C17DB3","name":"Set value of { variable }","value":"{date: {$.startDate}, 'Y-m-d'}T{date: {$.startDate}, 'H:i:s'}.000Z/{date: 'now', 'Y-m-d'}T{date: 'now', 'H:i:s'}.000Z"}]},{"id":"C7BE63EB-FFCD-428B-9802-D9BF2E68C752","type":"ShowBlock","disabled":false,"name":"output3","displayName":"Output 3","comment":"Looking for reloads completed since x","childId":"7C3738FB-7518-43EE-965D-9C358CABE004","inputs":[{"id":"input","value":"## App Reload Chain\n\n**Criteria:** Looking for reloads completed since {$.startDate} (with {$.reloadFinishedFilter})\n\nTo add/remove apps in the reload chain which respond to the source app, update tags on the source app (use the prefix \"{ $.prefixForChain }\").\n\n| Initial app ID | Initial app name | Initial app space ID | Tagged app ID | Tagged app name | Tagged app space ID | Target app result |\n| -- | -- | -- | -- | -- | -- | -- |","type":"string","structure":[]}],"settings":[{"id":"display_mode","value":"add","type":"select","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":120,"y":700},{"id":"7C3738FB-7518-43EE-965D-9C358CABE004","type":"VariableBlock","disabled":false,"name":"appCount","displayName":"Variable - appCount","comment":"Prepare the app counter","childId":"BA8765E6-BD7E-4931-B65F-D423BCEF7A96","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":0,"y":1100,"variableGuid":"0162DA79-7E02-4DF2-9D26-F254782145B5","operations":[{"id":"set_value","key":"EDDB12AD-2EB4-4CEE-B376-E80FB3F5EBFB","name":"Set value of { variable }","value":"0"}]},{"id":"BA8765E6-BD7E-4931-B65F-D423BCEF7A96","type":"VariableBlock","disabled":false,"name":"apps","displayName":"Variable - apps","comment":"Empty the app list before the run","childId":"FBD01531-AD77-41AC-9609-703500F2F5DE","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":610,"y":1600,"variableGuid":"3010B89C-2356-4C78-8A95-A3CB01F71314","operations":[{"id":"empty","key":"0A5EAAEA-A007-47CC-9E2C-AE690F464B97","name":"Empty { variable }","value":null}]},{"id":"FBD01531-AD77-41AC-9609-703500F2F5DE","type":"EndpointBlock","disabled":false,"name":"rawAPIListRequest2","displayName":"Qlik Cloud Services - Raw API List Request 2","comment":"Retrieve apps with a reload that finished since the last automation run","childId":"291D1684-C1AC-492B-A739-32F53A1D740A","inputs":[{"id":"c3a1c780-2076-11ec-98c4-dd329f9ef682","value":"audits","type":"string","structure":[]},{"id":"c6915fb0-2839-11ec-a450-03c7d8aebbe7","value":[{"key":"eventType","value":"com.qlik.v1.app.reload.finished"},{"key":"eventTime","value":"{$.reloadFinishedFilter}"}],"type":"object","mode":"keyValue","structure":[]}],"settings":[{"id":"maxitemcount","value":"","type":"string","structure":[]},{"id":"blendr_on_error","value":"stop","type":"select","structure":[]},{"id":"cache","value":"0","type":"select","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":0,"y":1340,"loopBlockId":"9865203A-F88D-4952-9171-21B91D5AC9AF","datasourcetype_guid":"61a87510-c7a3-11ea-95da-0fb0c241e75c","endpoint_guid":"4b993580-2072-11ec-8f59-e5aaa8656a36","endpoint_role":"list"},{"id":"9865203A-F88D-4952-9171-21B91D5AC9AF","type":"IfElseBlock","disabled":false,"name":"condition10","displayName":"Condition 10","comment":"If reload has finished successfully","childId":null,"inputs":[{"id":"conditions","value":{"mode":"all","conditions":[{"input1":"{$.rawAPIListRequest2.item.data.status}","input2":"ok","operator":"="}]},"type":"custom","structure":[]}],"settings":[],"collapsed":[{"name":"both","isCollapsed":false},{"name":"yes","isCollapsed":false},{"name":"no","isCollapsed":false}],"x":120,"y":2040,"childTrueId":"DB268610-F237-4D29-AAC0-2D8DFC0E6F0B","childFalseId":null},{"id":"DB268610-F237-4D29-AAC0-2D8DFC0E6F0B","type":"IfElseBlock","disabled":false,"name":"condition11","displayName":"Condition 11","comment":"If app not already in the list","childId":null,"inputs":[{"id":"conditions","value":{"mode":"all","conditions":[{"input1":"{$.apps}","input2":"{$.rawAPIListRequest2.item.data.id}","operator":"doesntContain"}]},"type":"custom","structure":[]}],"settings":[],"collapsed":[{"name":"both","isCollapsed":false},{"name":"yes","isCollapsed":false},{"name":"no","isCollapsed":false}],"x":503,"y":1545,"childTrueId":"CE7179B8-8124-4A5A-A145-D6F486AE42D5","childFalseId":null},{"id":"CE7179B8-8124-4A5A-A145-D6F486AE42D5","type":"VariableBlock","disabled":false,"name":"apps","displayName":"Variable - apps","comment":"","childId":null,"inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":360,"y":1600,"variableGuid":"3010B89C-2356-4C78-8A95-A3CB01F71314","operations":[{"id":"add_item","key":"25F0A314-E5FF-452A-AECE-C221F420D1BE","name":"Add item to { variable }","value":"{ object: '{\"id\":\"{$.rawAPIListRequest2.item.extensions.topLevelResourceId}\"}' }"}]},{"id":"8F9C4777-B9D1-4C16-9AC0-60714DF785FB","type":"VariableBlock","disabled":false,"name":"startDate","displayName":"Variable - startDate","comment":"Set timestamp to last execution time","childId":"E6A23136-09EB-4552-A50E-C369A17CDA0F","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":250,"y":360,"variableGuid":"B9D27E13-C323-414F-ABDC-7D30F6320CBA","operations":[{"id":"set_value","key":"6317704E-7226-4E4A-AE32-AD050599F410","name":"Set value of { variable }","value":"{date: {$.listAutomationRuns.item.startTime}}"}]},{"id":"E6A23136-09EB-4552-A50E-C369A17CDA0F","type":"VariableBlock","disabled":true,"name":"startDate","displayName":"Variable - startDate","comment":"Set a default start timestamp of now. This means no reloads will be triggered, unless this value is overwritten by a previously successful run of the automation.","childId":null,"inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":309,"y":1101,"variableGuid":"B9D27E13-C323-414F-ABDC-7D30F6320CBA","operations":[{"id":"set_value","key":"6317704E-7226-4E4A-AE32-AD050599F410","name":"Set value of { variable }","value":"{date: 'now - 6 hours'}"}]},{"id":"291D1684-C1AC-492B-A739-32F53A1D740A","type":"DeduplicateListBlock","disabled":false,"name":"deduplicateList","displayName":"Deduplicate List","comment":"Remove duplicates from the app list","childId":"99AFFC29-5544-4630-B5BE-CB47368BE1A4","inputs":[{"id":"list","value":"{$.apps}","type":"string","structure":[]},{"id":"key","value":"id","type":"field","structure":[]}],"settings":[{"id":"case_insensitive","value":null,"type":"checkbox","structure":[]},{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":true}],"x":-423,"y":2327,"loopBlockId":null},{"id":"99AFFC29-5544-4630-B5BE-CB47368BE1A4","type":"FilterListBlock","disabled":false,"name":"filterList2","displayName":"Filter List 2","comment":"Remove session apps","childId":"E3CD0C66-C0F7-408C-A0E9-7C76F917B60E","inputs":[{"id":"list","value":"{ $.deduplicateList }","type":"string","structure":[]},{"id":"conditions","value":{"mode":"all","conditions":[{"input1":"id","input2":"SessionApp_","operator":"doesntContain"}]},"type":"custom","structure":[]}],"settings":[{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":true}],"x":-459,"y":2446,"loopBlockId":null},{"id":"E3CD0C66-C0F7-408C-A0E9-7C76F917B60E","type":"VariableBlock","disabled":false,"name":"apps","displayName":"Variable - apps","comment":"Reset the apps variable for tidiness","childId":"899CC8F3-4BA0-455E-87A4-A8FD43101F83","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-484,"y":2636,"variableGuid":"3010B89C-2356-4C78-8A95-A3CB01F71314","operations":[{"id":"empty","key":"57149455-6BC1-498B-9B50-D9A1969C6228","name":"Empty { variable }","value":null},{"id":"merge","key":"0987CB9F-66AB-488F-B0D1-443D3A6C9FF1","name":"Merge other list into { variable }","value":"{$.filterList2}"}]},{"id":"CF0635E6-712F-4030-9072-3DCC141199E2","type":"ForEachBlock","disabled":false,"name":"loop2","displayName":"Loop 2","comment":"Loop over apps","childId":"CE54D05C-9720-4CC3-9D7E-9E71C9F06E5C","inputs":[{"id":"input","value":"{$.apps}","type":"string","structure":[]}],"settings":[{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-350,"y":2758,"loopBlockId":"6044D92E-3E2E-4726-AF4E-80435B61CC20"},{"id":"6044D92E-3E2E-4726-AF4E-80435B61CC20","type":"VariableBlock","disabled":false,"name":"appCount","displayName":"Variable - appCount","comment":"","childId":"718C7ED3-696C-45AF-A7F3-C9C9FF9A9B12","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":535,"y":2846,"variableGuid":"0162DA79-7E02-4DF2-9D26-F254782145B5","operations":[{"id":"add","key":"E950ACB1-32D8-4A08-A7FE-12B9FF887370","name":"Add to { variable }","value":"1"}]},{"id":"28C9DAA5-4BAB-482E-88C5-ACFA4393472B","type":"VariableBlock","disabled":false,"name":"iterAppSkipped","displayName":"Variable - iterAppSkipped","comment":"","childId":"20713926-C11D-4994-A3B9-85D65DA22C23","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":416,"y":8855,"variableGuid":"F9BF3686-6E78-48B1-B1C4-DBAD8EE6A62D","operations":[{"id":"add","key":"6CE46F3B-F418-4A41-97FD-00DD5FA7FB29","name":"Add to { variable }","value":"1"}]},{"id":"20713926-C11D-4994-A3B9-85D65DA22C23","type":"ShowBlock","disabled":false,"name":"output10","displayName":"Output 10","comment":"","childId":null,"inputs":[{"id":"input","value":"| [{$.rawAPIRequest2.data[0].resourceId}]({$.tenantHostname}/item/{$.rawAPIRequest2.data[0].id}/details) | {$.rawAPIRequest2.data[0].name} | [{$.getSpace.name}]({$.tenantHostname}/catalog?space_filter={$.rawAPIRequest2.data[0].spaceId}) | Skipped | Skipped | Skipped all apps as app not found, or app not in a managed space. |","type":"string","structure":[]}],"settings":[{"id":"display_mode","value":"add","type":"select","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":519,"y":3520},{"id":"0E46CB78-DA82-4C4B-9015-8199B9D48D5E","type":"VariableBlock","disabled":false,"name":"iterAppSkipped","displayName":"Variable - iterAppSkipped","comment":"","childId":"CF0635E6-712F-4030-9072-3DCC141199E2","inputs":[],"settings":[],"collapsed":[{"name":"loop","isCollapsed":false}],"x":250,"y":3200,"variableGuid":"F9BF3686-6E78-48B1-B1C4-DBAD8EE6A62D","operations":[{"id":"set_value","key":"80E494BA-2524-4F17-9DFF-858D6AC91EC4","name":"Set value of { variable }","value":"0"}]},{"id":"718C7ED3-696C-45AF-A7F3-C9C9FF9A9B12","type":"UpdateJobBlock","disabled":false,"name":"updateRunTitle3","displayName":"Update Run Title 3","comment":"","childId":"BF0D6CFE-D990-4BEF-AE72-FABC0AFFF269","inputs":[{"id":"title","value":"Working on app {$.appCount}/{count: {$.apps}}","type":"string","structure":[]}],"settings":[{"id":"automations_censor_data","value":false,"type":"checkbox","structure":[]}],"collapsed":[{"name":"loop","isCollapsed":false}],"x":-546,"y":3483}],"variables":[{"guid":"D8332648-F08B-4584-BF87-34ED2964F523","name":"prefixForChain","type":"string"},{"guid":"6FF47268-DA75-48B7-90CC-0DEE013758E4","name":"defaultTolerance","type":"number"},{"guid":"C9D9B5AF-5529-4D6A-AA0A-82C12E09013B","name":"iter","type":"number"},{"guid":"F3EC6156-449E-4809-9397-0F75EDD4F583","name":"reloadMessage","type":"string"},{"guid":"692444FC-47A7-4808-9FE3-3240D8142DE1","name":"iterReloadsTriggered","type":"number"},{"guid":"7F5E536A-0F92-4C59-880A-FC49F980FFF3","name":"iterReloadsFailed","type":"number"},{"guid":"80B11E95-030C-4E90-BF75-AAF0A13DFE3D","name":"appId","type":"string"},{"guid":"3A176EAC-D8A6-4C83-93C5-9B58D651FFD4","name":"iterReloadsSkipped","type":"number"},{"guid":"3B90860F-8E98-4896-B98D-4A38BFCF5EE2","name":"tenantHostname","type":"string"},{"guid":"35F9ACB6-FCBD-42C0-A6CB-D45C2B409E3E","name":"onlyManagedSpaces","type":"number"},{"guid":"55ADAF58-B67B-44D1-8F5C-11108AA3FE1C","name":"secondsSinceLastReload","type":"number"},{"guid":"0F4979FC-FF2B-4A50-BBC8-471BA750A9BC","name":"autoResolveAccessIssues","type":"number"},{"guid":"3010B89C-2356-4C78-8A95-A3CB01F71314","name":"apps","type":"list"},{"guid":"0162DA79-7E02-4DF2-9D26-F254782145B5","name":"appCount","type":"number"},{"guid":"D3CD2E22-D4C4-488A-8465-7781F1F9C294","name":"reloadFinishedFilter","type":"string"},{"guid":"B9D27E13-C323-414F-ABDC-7D30F6320CBA","name":"startDate","type":"string"},{"guid":"F9BF3686-6E78-48B1-B1C4-DBAD8EE6A62D","name":"iterAppSkipped","type":"number"}]}

Was this page helpful?