<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Obtain synthetic variable via workflow in Synthetic Monitoring</title>
    <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299033#M3381</link>
    <description>&lt;P&gt;Yeah, could work as a workaround.&lt;/P&gt;&lt;P&gt;The main problem is that the script defines this variable:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;var RINA_API_URL = "https://{environmentid}.live.dynatrace.com/api/v2/logs/ingest";&lt;/LI-CODE&gt;&lt;P&gt;but later it uses:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch(DT_LOG_INGEST_URL, ...)&lt;/LI-CODE&gt;&lt;P&gt;DT_LOG_INGEST_URL is not defined, so the request will fail before anything is ingested.&lt;/P&gt;&lt;P&gt;There is also another issue: &lt;STRONG&gt;rinaResponseBody&lt;/STRONG&gt; is used in the log payload, but it is not defined in the snippet. You first need to make the RINA API call with the token, read the response body, and only then send that result to Dynatrace Logs.&lt;/P&gt;</description>
    <pubDate>Tue, 05 May 2026 13:15:34 GMT</pubDate>
    <dc:creator>MaximilianoML</dc:creator>
    <dc:date>2026-05-05T13:15:34Z</dc:date>
    <item>
      <title>Obtain synthetic variable via workflow</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299006#M3374</link>
      <description>&lt;P&gt;Hi team,&lt;/P&gt;&lt;P&gt;I am trying to create a synthetic monitor that obtains a token via JavaScript and then makes an API call using that token as the Authorization token. After the API call, I want to send the result in an email.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elenaperez_0-1777977536676.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/33059iF7FE44F8DEF64B9B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="elenaperez_0-1777977536676.png" alt="elenaperez_0-1777977536676.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the best way to do this? Where can we store the token to use it later on a workflow?&lt;/P&gt;&lt;P&gt;We need a way to store the tokento use it because the result of a batch execution doesn't show the token.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Elena&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 10:41:02 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299006#M3374</guid>
      <dc:creator>elenaperez</dc:creator>
      <dc:date>2026-05-05T10:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain synthetic variable via workflow</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299014#M3375</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/58054"&gt;@elenaperez&lt;/a&gt;!&lt;/P&gt;&lt;P&gt;Could you share why you need to fetch the token from the Synthetic monitor with JavaScript?&lt;/P&gt;&lt;P&gt;Is the token only created after a browser login, or is it just stored in localStorage by the application?&lt;/P&gt;&lt;P&gt;Also, why not use Credential Vault instead? The usual pattern is to store the authentication secrets there, get the token directly in the Workflow, use it in the next API call, and then send the email. This is safer than trying to pass the token from Synthetic execution results.&lt;/P&gt;&lt;P&gt;I hope it helps you&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 11:16:37 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299014#M3375</guid>
      <dc:creator>MaximilianoML</dc:creator>
      <dc:date>2026-05-05T11:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain synthetic variable via workflow</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299017#M3376</link>
      <description>&lt;P&gt;The token is stored on the localstorage after doing some steps on the page. That is the only way to get it.&lt;/P&gt;&lt;P&gt;These are the steps before obtaining the token:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elenaperez_0-1777980295819.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/33062i64A0F5788009994D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="elenaperez_0-1777980295819.png" alt="elenaperez_0-1777980295819.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I store the token in the credential vault, which option should I select?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elenaperez_1-1777980358623.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/33063iFB23365EBA1F2847/image-size/medium?v=v2&amp;amp;px=400" role="button" title="elenaperez_1-1777980358623.png" alt="elenaperez_1-1777980358623.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And how do I get it from the workflow later?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 11:26:20 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299017#M3376</guid>
      <dc:creator>elenaperez</dc:creator>
      <dc:date>2026-05-05T11:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain synthetic variable via workflow</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299018#M3377</link>
      <description>&lt;P&gt;Thanks for sharing the steps.&lt;/P&gt;&lt;P&gt;Since the token is only created after the browser login and stored in localStorage, it makes sense that you are retrieving it with JavaScript inside the Synthetic monitor.&lt;/P&gt;&lt;P&gt;However, I would avoid storing that generated token in Credential Vault as I said. Credential Vault is intended for static credentials, such as username/password, client ID, client secret, or API keys, not for short-lived session tokens generated during a browser session.&lt;/P&gt;&lt;P&gt;If the API call depends on that localStorage token, the cleanest option is to perform the API call in the same Synthetic JavaScript step, immediately after reading the token.&lt;/P&gt;&lt;P&gt;If the final goal is to send the API result by email through a Workflow, then the better long-term design would be to move the authentication/API logic into the Workflow, using Credential Vault only for the login credentials or client credentials. The Workflow would then generate the token, call the API, format the result, and send the email.&lt;/P&gt;&lt;P&gt;For the Credential Vault scope:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Synthetic&lt;/STRONG&gt;: use this if the credential is only used by the Synthetic monitor.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;AppEngine&lt;/STRONG&gt;: use this if the credential needs to be used by Workflows/AppEngine actions.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I would not store the runtime token itself in Credential Vault unless there is no other option and you are aware of the expiration and security implications.&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 11:35:39 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299018#M3377</guid>
      <dc:creator>MaximilianoML</dc:creator>
      <dc:date>2026-05-05T11:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain synthetic variable via workflow</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299019#M3378</link>
      <description>&lt;P&gt;I am not sure I understand. If I do the API call from the workflow, how do I obtain the token generated from the synthetic?&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 11:40:15 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299019#M3378</guid>
      <dc:creator>elenaperez</dc:creator>
      <dc:date>2026-05-05T11:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain synthetic variable via workflow</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299020#M3379</link>
      <description>&lt;P&gt;You would not obtain the token generated by the Synthetic monitor from the Workflow. That is the key point.&lt;/P&gt;&lt;P&gt;The token created during the Synthetic execution belongs to that browser session runtime, and it is not meant to be passed later to a Workflow. Synthetic results also may hide sensitive values, so it is not a reliable place to extract a token from.&lt;/P&gt;&lt;P&gt;If the API call is done from the Workflow, then the Workflow should also obtain its own token. In that design, Credential Vault stores the static credentials, such as username/password, client ID, or client secret. Then the Workflow uses those credentials to authenticate, receives a new token, uses it in the API call, and sends the email.&lt;/P&gt;&lt;P&gt;So the desing would be something like this:&lt;/P&gt;&lt;PRE&gt;Workflow
  1. Read credentials from Credential Vault
  2. Authenticate and get a new token
  3. Call the API using that token
  4. Format the response
  5. Send the email&lt;/PRE&gt;&lt;P&gt;If the token can only be created by going through the browser flow in Synthetic and there is no backend authentication endpoint available, then the API call should stay inside the Synthetic JavaScript step, right after reading the token from &lt;STRONG&gt;Localstorage&lt;/STRONG&gt;. In that case, the Workflow&lt;STRONG&gt; will not&lt;/STRONG&gt; be able to reuse that Synthetic-generated token directly.&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 11:45:20 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299020#M3379</guid>
      <dc:creator>MaximilianoML</dc:creator>
      <dc:date>2026-05-05T11:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain synthetic variable via workflow</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299031#M3380</link>
      <description>&lt;P&gt;The only way to obtain the token is via the browser flow. What about sending the API result on a log?&lt;BR /&gt;Something is not working with my code:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;(async function() {
    // 1) Leer token RINA
    var rinaToken = localStorage.getItem("rina_token") || "";

    if (!rinaToken) {
        api.error("[RINA] Token not found");
        return;
    }

    // 2) Llamada a la API de RINA
    var RINA_API_URL = "https://{environmentid}.live.dynatrace.com/api/v2/logs/ingest";
    var DT_LOG_INGEST_TOKEN = "****";

    try {
        var logPayload = [{
            content: rinaResponseBody,
            attributes: {
                source: "synthetic-rina",
                api: "PendingMessages",
                synthetic: "browser-clickpath",
                environment: "prod"
            },
            timestamp: Date.now()
        }];

        var dtResp = await fetch(DT_LOG_INGEST_URL, {
            method: "POST",
            headers: {
                "Authorization": "Api-Token " + DT_LOG_INGEST_TOKEN,
                "Content-Type": "application/json; charset=utf-8"
            },
            body: JSON.stringify(logPayload)
        });

        api.info("[DT_LOG_INGEST] status=" + dtResp.status);

    } catch (e) {
        api.error("[DT_LOG_INGEST] error=" + (e &amp;amp;&amp;amp; e.message ? e.message : String(e)));
    }
})();&lt;/LI-CODE&gt;&lt;P&gt;I don't see any logs ingested with that format&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 13:05:17 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299031#M3380</guid>
      <dc:creator>elenaperez</dc:creator>
      <dc:date>2026-05-05T13:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain synthetic variable via workflow</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299033#M3381</link>
      <description>&lt;P&gt;Yeah, could work as a workaround.&lt;/P&gt;&lt;P&gt;The main problem is that the script defines this variable:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;var RINA_API_URL = "https://{environmentid}.live.dynatrace.com/api/v2/logs/ingest";&lt;/LI-CODE&gt;&lt;P&gt;but later it uses:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch(DT_LOG_INGEST_URL, ...)&lt;/LI-CODE&gt;&lt;P&gt;DT_LOG_INGEST_URL is not defined, so the request will fail before anything is ingested.&lt;/P&gt;&lt;P&gt;There is also another issue: &lt;STRONG&gt;rinaResponseBody&lt;/STRONG&gt; is used in the log payload, but it is not defined in the snippet. You first need to make the RINA API call with the token, read the response body, and only then send that result to Dynatrace Logs.&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 13:15:34 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299033#M3381</guid>
      <dc:creator>MaximilianoML</dc:creator>
      <dc:date>2026-05-05T13:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain synthetic variable via workflow</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299036#M3382</link>
      <description>&lt;P&gt;After fixing, I get this error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elenaperez_0-1777988194127.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/33067i2C5A81BC2D7FDFA4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="elenaperez_0-1777988194127.png" alt="elenaperez_0-1777988194127.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 13:36:39 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299036#M3382</guid>
      <dc:creator>elenaperez</dc:creator>
      <dc:date>2026-05-05T13:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain synthetic variable via workflow</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299039#M3383</link>
      <description>&lt;P&gt;Can I see the StackTrace complete, please?&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 13:38:58 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299039#M3383</guid>
      <dc:creator>MaximilianoML</dc:creator>
      <dc:date>2026-05-05T13:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain synthetic variable via workflow</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299042#M3384</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elenaperez_0-1777988432593.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/33068i8A1FC1E9593B94F9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="elenaperez_0-1777988432593.png" alt="elenaperez_0-1777988432593.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elenaperez_1-1777988512010.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/33069iC56BC49626B428D7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="elenaperez_1-1777988512010.png" alt="elenaperez_1-1777988512010.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 13:41:57 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299042#M3384</guid>
      <dc:creator>elenaperez</dc:creator>
      <dc:date>2026-05-05T13:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain synthetic variable via workflow</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299045#M3385</link>
      <description>&lt;P&gt;How is your JS code now, after you fixed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 13:50:25 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299045#M3385</guid>
      <dc:creator>MaximilianoML</dc:creator>
      <dc:date>2026-05-05T13:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain synthetic variable via workflow</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299050#M3386</link>
      <description>&lt;LI-CODE lang="javascript"&gt;(async function() {
    // 1) Leer token RINA
    var rinaToken = localStorage.getItem("rina_token") || "";

    if (!rinaToken) {
        api.error("[RINA] Token not found");
        return;
    }

    // 2) Llamada a la API de RINA
    var RINA_API_URL = "https://rinaes01.portal.ss/eessiRest/PendingMessages?date=2026-05-05";
    var rinaResponseBody = "";

    try {
        var rinaResp = await fetch(RINA_API_URL, {
            method: "GET",
            headers: {
                "Authorization": "Bearer " + rinaToken,
                "Content-Type": "application/json"
            }
        });

        rinaResponseBody = await rinaResp.text();
        api.info("[RINA] API status=" + rinaResp.status);

    } catch (e) {
        api.error("[RINA] API error=" + (e &amp;amp;&amp;amp; e.message ? e.message : String(e)));
        return;
    }&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 05 May 2026 14:01:44 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299050#M3386</guid>
      <dc:creator>elenaperez</dc:creator>
      <dc:date>2026-05-05T14:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain synthetic variable via workflow</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299051#M3387</link>
      <description>&lt;LI-CODE lang="javascript"&gt; // 3) Ingestar el RESULTADO de la API en Dynatrace Logs
    var DT_LOG_INGEST_URL = "https://{environmentid}.live.dynatrace.com/api/v2/logs/ingest";
    var DT_LOG_INGEST_TOKEN = "***";

    try {
        var logPayload = [{
            content: rinaResponseBody,
            attributes: {
                source: "synthetic-rina",
                api: "PendingMessages",
                synthetic: "browser-clickpath",
                environment: "prod"
            },
            timestamp: Date.now()
        }];

        var dtResp = await fetch(DT_LOG_INGEST_URL, {
            method: "POST",
            headers: {
                "Authorization": "Api-Token " + DT_LOG_INGEST_TOKEN,
                "Content-Type": "application/json; charset=utf-8"
            },
            body: JSON.stringify(logPayload)
        });

        api.info("[DT_LOG_INGEST] status=" + dtResp.status);

    } catch (e) {
        api.error("[DT_LOG_INGEST] error=" + (e &amp;amp;&amp;amp; e.message ? e.message : String(e)));
    }
})();&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 05 May 2026 14:02:11 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299051#M3387</guid>
      <dc:creator>elenaperez</dc:creator>
      <dc:date>2026-05-05T14:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain synthetic variable via workflow</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299052#M3388</link>
      <description>&lt;P&gt;The code looks close, but I would check the exact error returned by the Synthetic execution first. Is it Failed to fetch, 401, 403, 400, or only the stack frame with &lt;STRONG&gt;Object.fail&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;Since this runs inside a Synthetic browser clickpath, the call to the Dynatrce Log Ingest API is executed from the browser context. This means it can be blocked by CORS or browser security restrictions, even if the token and payload are correct.&lt;/P&gt;&lt;P&gt;Can you also log the response body from the Log Ingest call?&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 14:07:13 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299052#M3388</guid>
      <dc:creator>MaximilianoML</dc:creator>
      <dc:date>2026-05-05T14:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain synthetic variable via workflow</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299054#M3389</link>
      <description>&lt;P&gt;Where can I see the response logged with&amp;nbsp;api.info("[DT_LOG_INGEST] response body=" + dtRespBody); ?&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 14:21:05 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299054#M3389</guid>
      <dc:creator>elenaperez</dc:creator>
      <dc:date>2026-05-05T14:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain synthetic variable via workflow</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299055#M3390</link>
      <description>&lt;P&gt;In the Synthetic monitor execution details.&amp;nbsp;Open the Synthetic monitor, then go to the latest execution result or failed execution. In the execution details, open the specific step where the custom JavaScript runs. The messages written with api.info() should appear in the step logs/details for that execution.&lt;/P&gt;&lt;P&gt;If nothing appears, it may mean the script failed before reaching that line, or that the fetch() call failed before a response was returned. In that case, add an api.info() right before the fetch() and keep the catch block with api.error() to confirm where it stops.&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 14:23:27 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299055#M3390</guid>
      <dc:creator>MaximilianoML</dc:creator>
      <dc:date>2026-05-05T14:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain synthetic variable via workflow</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299057#M3391</link>
      <description>&lt;P&gt;I added the api.info() before the fetch and don't see anything&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elenaperez_0-1777991620252.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/33070i4EA0D22C21539989/image-size/medium?v=v2&amp;amp;px=400" role="button" title="elenaperez_0-1777991620252.png" alt="elenaperez_0-1777991620252.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 14:33:45 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299057#M3391</guid>
      <dc:creator>elenaperez</dc:creator>
      <dc:date>2026-05-05T14:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain synthetic variable via workflow</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299060#M3392</link>
      <description>&lt;P data-unlink="true"&gt;Try using &lt;STRONG&gt;api.startAsyncSyntheticEvent()&lt;/STRONG&gt; at the beginning of the JavaScript step and &lt;STRONG&gt;api.finish()&lt;/STRONG&gt; at the end of every success/error path. Here is the &lt;A href="https://docs.dynatrace.com/docs/shortlink/id-brower-clickpath-events#javascript-event-api" target="_blank"&gt;doc&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 14:54:39 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299060#M3392</guid>
      <dc:creator>MaximilianoML</dc:creator>
      <dc:date>2026-05-05T14:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain synthetic variable via workflow</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299061#M3393</link>
      <description>&lt;P&gt;Like this code:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;api.startAsyncSyntheticEvent();

(async function () {
  try {
    var rinaToken = localStorage.getItem("rina_token") || "";

    if (!rinaToken) {
      api.error("[RINA] Token not found");
      api.finish();
      return;
    }

    var RINA_API_URL = "https://{environmentid}.live.dynatrace.com/api/v2/logs/ingest";
    var DT_LOG_INGEST_TOKEN = "***";

    var logPayload = [{
      content: rinaResponseBody,
      loglevel: "INFO",
      "log.source": "synthetic-rina",
      "rina.api": "PendingMessages",
      "synthetic.type": "browser-clickpath",
      environment: "prod",
      "rina.status_code": String(rinaResp.status),
      timestamp: Date.now()
    }];

    var dtResp = await fetch(DT_LOG_INGEST_URL, {
      method: "POST",
      headers: {
        "Authorization": "Api-Token " + DT_LOG_INGEST_TOKEN,
        "Content-Type": "application/json; charset=utf-8"
      },
      body: JSON.stringify(logPayload)
    });

    var dtRespBody = await dtResp.text();
    api.info("[DT_LOG_INGEST] status=" + dtResp.status + " body=" + dtRespBody);

    api.finish();

  } catch (e) {
    api.error("[SCRIPT] error=" + (e &amp;amp;&amp;amp; e.message ? e.message : String(e)));
    api.finish();
  }
})();&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 05 May 2026 14:55:08 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Obtain-synthetic-variable-via-workflow/m-p/299061#M3393</guid>
      <dc:creator>MaximilianoML</dc:creator>
      <dc:date>2026-05-05T14:55:08Z</dc:date>
    </item>
  </channel>
</rss>

