Berto2002 Posted September 8, 2022 Posted September 8, 2022 I have the following nodes where the expression uses the company picked up from the "get customers company" node to make a decision about whether or not to send an email and that works (We only get the email under the right circumstances): The email has the following statement: "{{.H_fk_user_name}} who works for {{.H_company_name}} has been issued with a Mobile Phone / SIM and you asked to be notified for billing purposes" But the result when sent is: "[name correctly populated as the Customer] who works for {{.H_company_name}}"; the H_company_name is not pulling-through the Company despite that being known in the workflow for the expression to use immediately prior. Can anyone help with what I am doing wrong here? Thanks, Berto
Victor Posted September 8, 2022 Posted September 8, 2022 @Berto2002 can you detail the "Get Customer Company" node and the "Yes" expression please?
Berto2002 Posted September 8, 2022 Author Posted September 8, 2022 hi. I have just blacked-out the text of the names of the companies
Victor Posted September 8, 2022 Posted September 8, 2022 @Berto2002 and the "Get Customer Company" node?
Victor Posted September 8, 2022 Posted September 8, 2022 42 minutes ago, Berto2002 said: the H_company_name is not pulling-through the Company despite that being known in the workflow for the expression to use immediately prior @Berto2002 ok so, basically this statement is incorrect. {{.H_company_name}} is an email template variable and only used in email templates. In workflows you have workflow variables which are different than email template variables. The value for {{.H_company_name}} variable in an email template is retrieved from h_itsm_requests.h_company_name. If this has no value in the database for the respective record, the email will display {{.H_company_name}} (this is the default behaviour which can be changed by formatting the variable in email template configuration). "Get Request Information -> Customer Details" node will set the value for the "Company" parameter from h_sys_groups.h_name based on h_sys_account_groups.h_group_id for the respective user. As you can probably imagine, "h_itsm_requests.h_company_name" and "h_sys_groups.h_name based on h_sys_account_groups.h_group_id for the respective user" will not always be the same. I believe in your test h_itsm_requests.h_company_name is empty (no value) which means the request is associated with a customer but not a company while "h_sys_groups.h_name based on h_sys_account_groups.h_group_id for the respective user" does have a value given the user is associated with one (or more) organisations.
Berto2002 Posted September 8, 2022 Author Posted September 8, 2022 @Victor. I think I get it. I think the final part of your explanation is missing :-)... How do I get the company name for the customer of the request to appear in the email?
Victor Posted September 8, 2022 Posted September 8, 2022 @Berto2002 you can make use of {{Customer Coworker.H_home_organization}} but that means a) user needs to have a Home Organisation set (which I would assume it does) and b) this actually gives you the org ID, not the name so it might not be what you are after in an email... If we need the name in the email this becomes a bit more convoluted, won't be that straight forward... 1. Get User Details (we need the Home Org from this one) 2. Get Organisation Details (we need the Name from this one) 3. Store the "Name" value somewhere on the request, most likely a custom field 4. Use the custom field variable in the email template to output the company name
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now