SJEaton Posted January 24, 2023 Author Posted January 24, 2023 I'm so sorry I have to dash out now, but hopefully you can fathom what's needed from what I've sent. I will log in again after 7pm to see if you've asked for anything else. Or we can pick up again first thing tomorrow, Thanks for your help! Sam
Steve Giller Posted January 24, 2023 Posted January 24, 2023 Try: ('{{.H_custom_k}}' LIKE '%Basildon%' AND '{{.H_custom_o}}' = 'INR Star') OR ('{{.H_custom_k}}' LIKE '%Basildon%' AND '{{.H_custom_t}}' = 'INR Star') and let us know how the test goes, please.
SJEaton Posted January 25, 2023 Author Posted January 25, 2023 Good morning @Steve Giller, this test output both values that where held in k as shown. INR Star was entered in custom t field when I selected Basildon. I then selected Southend and entered Datix Q in custom o. This is shown in the custom fields as follows. In this test, the email is only interested in INR Star so shouldn't present 'Southend'. I have 3 expressions set up though so it seems it's now presenting all those that are in custom k. ('{{.H_custom_k}}' LIKE '%Basildon%' AND '{{.H_custom_o}}' = 'INR Star') OR ('{{.H_custom_k}}' LIKE '%Basildon%' AND '{{.H_custom_t}}' = 'INR Star') ('{{.H_custom_k}}' LIKE '%Broomfield (Mid)%' AND '{{.H_custom_o}}' = 'INR Star') OR ('{{.H_custom_k}}' LIKE '%Broomfield (Mid)%' AND '{{.H_custom_t}}' = 'INR Star') ('{{.H_custom_k}}' LIKE '%Southend%' AND '{{.H_custom_o}}' = 'INR Star') OR ('{{.H_custom_k}}' LIKE '%Southend%' AND '{{.H_custom_t}}' = 'INR Star') Maybe I need to approach this differently? Sam
Steve Giller Posted January 25, 2023 Posted January 25, 2023 1 hour ago, SJEaton said: In this test, the email is only interested in INR Star so shouldn't present 'Southend'. Why shouldn't it present 'Southend'? ('{{.H_custom_k}}' LIKE '%Southend%' AND '{{.H_custom_o}}' = 'INR Star') OR ('{{.H_custom_k}}' LIKE '%Southend%' AND '{{.H_custom_t}}' = 'INR Star') So: '{{.H_custom_k}}' LIKE '%Southend%' -> YES '{{.H_custom_o}}' = 'INR Star' -> NO '{{.H_custom_k}}' LIKE '%Southend%' -> YES '{{.H_custom_t}}' = 'INR Star' -> YES becomes '{{.H_custom_k}}' LIKE '%Southend%' AND '{{.H_custom_o}}' = 'INR Star' -> NO '{{.H_custom_k}}' LIKE '%Southend%' AND '{{.H_custom_t}}' = 'INR Star' -> YES as this is testing for either being YES, it matches.
SJEaton Posted January 25, 2023 Author Posted January 25, 2023 5 minutes ago, Steve Giller said: Why shouldn't it present 'Southend'? It shouldn't present Southend as INR Star wasn't selected in custom o, which is the question that is answered if Southend is selected in custom k. INR Star was selected in custom t which is the question that is answered if Basildon is selected in custom k. The customer is basically asking for INR Star at Basildon, and Datix Q at Southend, so in the INR Star system access request email that generates, I'm only interested in pulling through Basildon. There will be a Datix Q email that will need to present Southend once I get this sussed. So what I'm after is: IF '{{.H_custom_k}}' CONTAINS '%Basildon%' AND '{{.H_custom_o}}' CONTAINS 'INR Star' OR '{{.H_custom_t}}' CONTAINS 'INR Star' then present 'Basildon' in the email. IF '{{.H_custom_k}}' CONTAINS '%Southend%' AND '{{.H_custom_o}}' CONTAINS 'INR Star' OR '{{.H_custom_t}}' CONTAINS 'INR Star' then present 'Southend' in the email. I tried to use CONTAINS but it didn't work. Maybe I'm trying to be too clever?
Steve Giller Posted January 25, 2023 Posted January 25, 2023 Firstly, there is no such function as CONTAINS. This is a term that is used in the UI because it's more friendly than the LIKE function that it is using behind the scenes. So using CONTAINS will never work. Secondly, if the "Systems" question maps to Custom O for Southend and Custom T for Basildon ... why are you including both in both ESP conditions? Thirdly, if Custom O and Custom T are both populated by checklists, then as soon as more than one is selected the '=' is going to fail and you'll need a LIKE comparison. If you selected Basildon as your Primary Site would the "What hospital sites will the new joiner be accessing this system from?" question give options of Broomfield and Southend? If so, which Custom Field would the Broomfield answers go into?
SJEaton Posted January 25, 2023 Author Posted January 25, 2023 OK, I'll try and explain. The customer selects a primary site, and then is asked if they want access to any systems at other sites - this is custom k. Depending on the primary site selected, custom k lists the other 2 sites, so yes a primary site of Basildon will give options for Broomfield or Southend. Custom fields O and T are then for the relevant sites. T is the first one listed in K and O is the second one listed in K. I'm therefore including all 3 ESP conditions in the email template and want them only to present based on what site is relevant for when INR Star is selected. All of what you are saying above is making me think that I can't achieve this in this way now due to how I have the questions set up in the IC .
Steve Giller Posted January 25, 2023 Posted January 25, 2023 You're trying to hit a moving target with your ESP conditions, which is going to cause issues. I would suggest fixing the Custom Fields to the Sites, for example: Basildon - Custom_P Broomfield - Custom_Q Southend - Custom_R Then, regardless of the selections, you should be able to use: Basildon: ('{{.H_custom_k}}' LIKE '%Basildon%' AND '{{.H_custom_p}}' LIKE '%INR Star%') Broomfield: ('{{.H_custom_k}}' LIKE '%Broomfield%' AND '{{.H_custom_q}}' LIKE '%INR Star%') Southend: ('{{.H_custom_k}}' LIKE '%Southend%' AND '{{.H_custom_r}}' LIKE '%INR Star%') If you needed to include other systems you could add them to the expression without forgetting the brackets, for example: ('{{.H_custom_k}}' LIKE '%Basildon%' AND ('{{.H_custom_p}}' LIKE '%INR Star%' OR '{{.H_custom_p}}' LIKE '%Datix Q%')) Caveat: I'm not 100% clear on how your Capture is gathering the information, so this may need tweaking. 1
SJEaton Posted January 25, 2023 Author Posted January 25, 2023 Hi Steve, I don't have any free custom fields left to fix a custom field for each site. The IC is also very complex and at this late stage I don't want to be mucking about with it too much as we really do want to go out to pilot asap. We have therefore made a decision to deal with this in the BPM for the time being, i.e. create separate email templates for each site access that generate based on a decision as to whether the system is selected with O or T being Basildon or not. We will then return to look at the potential for using the ESP Condition post Pilot. Thanks for your help. Sam
SJEaton Posted January 25, 2023 Author Posted January 25, 2023 Hi @Steve Giller Scrap what I said earlier, I free'd up a custom field and decided to have a go at your suggestion instead. I made the custom fields as follows and then used the suggested expressions. Basildon - Custom_L Broomfield - Custom_O Southend - Custom_T Basildon: ('{{.H_custom_k}}' LIKE '%Basildon%' AND '{{.H_custom_l}}' LIKE '%INR Star%') Broomfield: ('{{.H_custom_k}}' LIKE '%Broomfield%' AND '{{.H_custom_o}}' LIKE '%INR Star%') Southend: ('{{.H_custom_k}}' LIKE '%Southend%' AND '{{.H_custom_t}}' LIKE '%INR Star%') On testing, all of these seem to be working! I shall therefore proceed with this approach for all relevant systems. Thanks again Sam
Steve Giller Posted January 25, 2023 Posted January 25, 2023 @SJEaton That's great news. Just to reiterate - if you add to the list of systems it will be vital that you include the brackets! 1
SJEaton Posted January 26, 2023 Author Posted January 26, 2023 Hi @Steve Giller I don't suppose I can use the same expressions in Human Task Details can I? I know I can pull variables in but wasn't sure if I can use expressions in Task Details or not? Thanks, Sam
Steve Giller Posted January 26, 2023 Posted January 26, 2023 @SJEaton No, ESP conditions are exclusive to Email Templates
SJEaton Posted January 26, 2023 Author Posted January 26, 2023 @Steve Giller so for scenarios where certain systems require a human task to generate rather than an email, how best might I present the sites that are relevant to the system access required in the task details so the task owner knows what sites to grant access to? Ideally I would like to put the following in the task details but if I can't, is there another solution??? ('{{.H_custom_k}}' LIKE '%Basildon%' AND '{{.H_custom_l}}' LIKE '%Eden%') THEN 'Basildon' ('{{.H_custom_k}}' LIKE '%Broomfield%' AND '{{.H_custom_o}}' LIKE '%Eden%') THEN 'Broomfield' ('{{.H_custom_k}}' LIKE '%Southend%' AND '{{.H_custom_t}}' LIKE '%Eden%') THEN 'Southend'
Steve Giller Posted January 26, 2023 Posted January 26, 2023 Decision nodes in the BPM generating a Task with the relevant details would be the way forward here.
Berto2002 Posted April 20, 2023 Posted April 20, 2023 @Steve Giller. I have these esp conditions in an email template which seems to work MOST of the time to swap-out the banner dependent on the service. <esp-condition contenteditable="false" expression="'{{.h_fk_servicename}}'!='Councillor Casework'"><img alt="" height="126px" src="https://lon-p01-api.hornbill.com/xxx/dav/share/img/inline/nkeS-PPnB9a?t=1669217245092" /></esp-condition> <esp-condition contenteditable="false" expression="'{{.h_fk_servicename}}'='Councillor Casework'"><img alt="" height="126px" src="https://lon-p01-api.hornbill.com/xxx/dav/share/img/inline/a993My_OwLq?t=1675075967828" /></esp-condition> But some of my update emails are getting no banner which implies neither of those conditions are being met (see below). The two cases I have seen with this issue have a "?" character in the Service Name. Two questions here: Is the "?" throwing-out the esp evaluation? If so should it be doing that or should it cater? Regardless of the above, is there a general "ELSE"-type esp-condition you can suggest that ensures a given banner is always placed, even if the expression="'{{.h_fk_servicename}}'='Councillor Casework' fails to evaluate? Example of the blue banner working; Example of the red banner working (both using this same template): Example of one with no banner: 1
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