function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Fred13Fred13 

Assign variables from URL to Attributes

Can anyone advise how I can get variable from a url and store them as attributes that I can use to filter data?  Here is my current url:

lightning/n/Group_Structures_List?Aid=001q000000nv4YT&Tid=001q000000nv52W

I need to understand how I create two different variables... Aid should hold the id that follows the and Tid should hold the id that follows.

Thank you!!

Fred
Alex SelwynAlex Selwyn
({ doInit : function(component, event, helper) {
          console.log(component.get("v.pageReference").state.Aid);
          console.log(component.get("v.pageReference").state.Tid);
    }
})

Learn more here.https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_navigation.htm

Thanks,
Alex.
Fred13Fred13
Thanks Alex.. I see this is getting the value.. however, I am trying to figure out how to set these attributes from the URL.

thanks!!!

Fred