You need to sign in to do that
Don't have an account?
Jonathan Wolff 7
Get Id from URL into aura component
Hi, I have a Site with the URL of this form:
https//: MySite.com/FSR/s/?RecordID=0027a00003JsuTW
I also have a custom flow component within the Site which creates a rich text field. I would like to use the ID from the URL into the Component. I pass the RecordID with an email so its not possible to just query it. Could you tell me how to change my code to get the Id from the URL?
My custom flow component:
Controller
https//: MySite.com/FSR/s/?RecordID=0027a00003JsuTW
I also have a custom flow component within the Site which creates a rich text field. I would like to use the ID from the URL into the Component. I pass the RecordID with an email so its not possible to just query it. Could you tell me how to change my code to get the Id from the URL?
My custom flow component:
<aura:component implements="lightning:availableForFlowScreens,force:hasRecordId, force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" > <aura:attribute name="label" type="String" access="global" /> <aura:attribute name="value" type="String" access="global" /> <aura:attribute name="required" type="Boolean" access="global" /> <aura:attribute name="placeHolder" type="String" access="global" /> <aura:handler name="init" value="{!this}" action="{! c.doInit }" /> <aura:attribute name="validate" type="Aura.Action" /> <lightning:inputRichText value="{!v.value}" required="{!v.required}" placeHolder="{!v.placeHolder}" labelVisible="true" variant="bottom-toolbar" label="{!v.label}"> <lightning:insertImageButton/> </lightning:inputRichText> </aura:component>
Controller
({ doInit: function(component, event, helper) { component.get("v.recordId"); component.set('v.validate', function() { var userInput = component.get('v.value'); if(userInput) { return { isValid: true }; } else if(!userInput && component.get("v.required")){ return { isValid: false, errorMessage: 'A value is required.' }; }else{ return{ isValid: true}; } }); } })