Re: Dealing with array variables in conditions (535 Views)
Reply
Trusted Contributor
lwvirden
Posts: 572
Registered: ‎04-22-2008
Message 1 of 7 (535 Views)
Accepted Solution

Dealing with array variables in conditions

During the process of writing notification message bodies and activity action, I have found some "warts" in the process. For instance, output of arrays is pretty limited. It does not appear to work to put an array, and other information, into the description field of an activity action (this is the info that is logged into the historic activity log tab of an incident).

 

I had similar tough times dealing with arrays in email messages - I ended up deleting them from the messages in an effort to streamline the messages.

 

I am now trying to figure out if I can even put an array into a condition for one of these things. For instance, I have the condition:

not null(description in $L.file.save) and not same(description in $L.file.save, nullsub(description in $L.file, "BLANK"))

 

so that I can log the previous value of description in the log.  But I am not seeing anything appear.

 

Is there any special trick to this kind of condition that I am missing?

 

Thank you!

Trusted Contributor
tprovin
Posts: 229
Registered: ‎11-05-2009
Message 2 of 7 (535 Views)

Re: Dealing with array variables in conditions

What type of ticket are you trying to do this with?  The reason I ask is because I am able to make it work for Incidents with the following condition (hint: action is the name of the description field).

 

not null(action in $L.file.save) and not same(action in $L.file.save, nullsub(action in $L.file, "BLANK"))

 

As for the description in your activity action, that may be tricky to get right but I have a feeling your get it.

 

So do you want to talk about this ... "I had similar tough times dealing with arrays in email messages - I ended up deleting them from the messages in an effort to streamline the messages."  Arrays in emails aren't very fun to work with, but they can be done in a way that makes them useful.  If you want to try to get them in your messages, let me know where you were having issues and I will be glad to try to help with it.

Thanks,

Tim
Trusted Contributor
lwvirden
Posts: 572
Registered: ‎04-22-2008
Message 3 of 7 (535 Views)

Re: Dealing with array variables in conditions

I am trying to get my activity action on a probsummary Update Activities activity actions. This is the category, from what I can tell, associated with IM.update.incident.It appears that, for that entry that I sent, I either didn't read my notes properly, or I have a problem in yet another action where the name is wrong.  Thanks for pointing out the action, not description, Sigh.

 

I'm sure THAT will fix that one.

 

As for the other tough times, we were trying in an early test of notification msg bodies to display the description field as well as the solution field. We were ending up with partial information being displayed. However, what we decided was that it wasn't really essential to the message - because the message has the URL for the ticket in it. People can just go there. So we trimmed out a lot of the "extraneous" information to streamline the messages.

 

I _think_ that the fix to the variable name should solve the problem I was seeing here.

 

As far as you know, though, I can use array variables in condtions using null() and same()?

Trusted Contributor
tprovin
Posts: 229
Registered: ‎11-05-2009
Message 4 of 7 (535 Views)

Re: Dealing with array variables in conditions

It's always something simple like the wrong name or a missing $L.file.  :smileyhappy:  You can use the null() and same() functions on arrays, and 99% of the time things will work out for you. 

 

As for the description and solution in notifications, these can be done in a very simple way.  When you create your form for the notification, you will of course be using a text area for these fields.  Once they are there, you need to go to the predesign page for the form, and select "Format Details" from the menu.  Here you will need to set the the following values to make them work.

 

Ctrl: 512

Length: A value greater then what you would expect to find in the field (I use 1000)

Attribute: 1

Window: -9

 

This creates a text area that will expand with the data that is entered into it.  If this isn't the last line on your form (which is wouldn't be if you have both), you want to put the next item only one "Line" down. 

 

This image is my closure format for Incidents, and it contains the Description and resolution at the bottom. 

 

173i78C172DFAE6DDFFF

 

When the mail comes out it will look something like the following ...

 

------------------------------------------------------------------------

 

Contact Name: Test Email

Location: Test Area

Room: 1

 

Description:

This is a test email to show the formating.

The description field will scroll to as many lines as needed.

 

Resolution:

The resolution label will end up one line down from the end of the description because of how it was set in the Format Details. 

This area will also scroll to whatever length is needed.

 

-----------------------------------------------------------------------------------------------

 

Hope this helps and gives you some ideas on what you can do with your notifications.

Thanks,

Tim
Trusted Contributor
lwvirden
Posts: 572
Registered: ‎04-22-2008
Message 5 of 7 (535 Views)

Re: Dealing with array variables in conditions

Thank you so much! I will squirrel this away - I have no doubt this will resurface as users begin using the system on a regular basis!

Trusted Contributor
tprovin
Posts: 229
Registered: ‎11-05-2009
Message 6 of 7 (535 Views)

Re: Dealing with array variables in conditions

It's no problem ... As always I am just glad I can help out.  I am assuming that changing your activity action from "description" to "action" fixed the original issue?

Thanks,

Tim
Trusted Contributor
lwvirden
Posts: 572
Registered: ‎04-22-2008
Message 7 of 7 (535 Views)

Re: Dealing with array variables in conditions

Yes, that fixed it right up. I still don't know if I tried to use something from another activity action or just had fingers typing something different than the eyes were seeing. Once I finish entering all the actions, I'll have to go back and make certain.  But things are looking pretty good right now, thanks to your help.

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.