I have a list that contains user accounts. When trying to perform an O365 User Profile Lookup you need the User Principal Email address associated with the O365 account (this is really stupid). There is an option to format the User Field for an email address but our User Principal Email addresses are not the same as our Primary Addresses so this formatting retrieves our Primary Email address which causes the lookup to fail. The UPN email can be found by formatting for User Account but it gives you the full claims account (i:firstname.lastname@example.org).
How can I strip off the claims portion "i:0#.f|membership|" so that I have the correct email address to perform the User Profile Lookup?