I am trying to pull the URL for whatever record the user is on when they launch my screenflow.
For example if they are on an account I would need the account URL: "https://mydomain--partial.lightning.force.com/lightning/r/Account/00000000000000/view"
If they are on a report, I would need the report URL: "https://mydomain--partial.lightning.force.com/lightning/r/Report/00000000000000000/view?queryScope=userFolders"
My screenflow launches from a utility action.
I'm using the following formula in the screenflow now
(LEFT({!$Api.Partner_Server_URL_260}, FIND( '.com', {!$Api.Partner_Server_URL_260} )) + RIGHT({!$Api.Partner_Server_URL_260}, FIND( '.com', {!$Api.Partner_Server_URL_260} )))
The problem is that this returns: "https://mydomain--partial.my.salesforce.com/services/Soap/u/26.0/00000000000"
I solved my own question and wanted to share just in case anyone came across this in the future.
What I had to do was:
CMP:
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction,lightning:isUrlAddressable" access="global" >
<aura:handler name="init" value="{!this}" action="{!c.init}"/>
<lightning:flow aura:id="FLOW NAME"/>
</aura:component>
Controller:
({
init : function (cmp) {
var flow = cmp.find("FLOWNAME");
var inputVariables = [
{
name : 'vCurentlURL',
type : 'String',
value : window.location.href,
}
];
flow.startFlow("FLOWNAME", inputVariables );
}
})