NOTICE: Branded Content
NOTICE: Certain versions of content (“Material”) accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.
IT Asset Manager / Connect-IT User Discussions
cancel

Connect-IT Help

TimLothian Contributor.
Contributor.

Connect-IT Help

Hi, I have created a scenario to export Portfolio Items to CSV. However, I want to specify that the AssetTag should begin with "BU" and that the record was updated in the last 24 hours.

I have tried many variations in the mapping script to specify this. But always get a "Basic code compilation error". So have come the realisation that I need help.

Could someone give me the correct way to script this, please? I can then use that as basis to further my knowledge.

Many thanks in advance

Tim

5 REPLIES
Mark Cullen_1 Acclaimed Contributor.
Acclaimed Contributor.

Re: Connect-IT Help

The date aspect is always the tricky part.  I assume this "filtering" logic will be placed in the produced document WHERE clause attribute so go into the AM Client application, open the portfolio screen, and work on the logic there (in a query filter) then copy/paste into scenario.

Mark Cullen_1 Acclaimed Contributor.
Acclaimed Contributor.

Re: Connect-IT Help

Something like...

[AssetTag] LIKE 'BU%' AND [dtLastModif] >= amDateAddLogical(Date(),-86400) - single quotes may have to change to double quotes as I can never remember how the syntax is accepted.

GoldenRatioRJP Honored Contributor.
Honored Contributor.

Re: Connect-IT Help

1) Consider using the Export Tool for this not CIT

2) Rather than putting this logic in the Root Mapping you would be better served butting it in the WHERE condition of the Document Definition.  No point if Producing a bunch of Documents you are going to Ignore/Reject when you can just limit what you Produce.  The syntax would be the same as a Query Filter on the amPortfolio table to limit to what you want.

(AssetTag LIKE 'BU%') AND (SecondsDiff(GetDate(), dtLastModif) < 86400)

Depending on whether you trully want within the last 24 hours or since "anytime yesterday" the function you should use will be different.  SecondsDiff or DaysDiff are likelly what you need though.

Cheers....

 

Russell Parker, CITAM, CHAMP, CSAM
President - Golden Ratio, Inc.
Russ.Parker@GoldenRatioInc.com
TimLothian Contributor.
Contributor.

Re: Connect-IT Help

Thanks for the replies. I will give them a try. To clarify, the reason for using Connect-IT rather than Export Tool as I want this to run every day unattended. Connect-IT will also put the file onto another server where it is needed.

 

Tim

GoldenRatioRJP Honored Contributor.
Honored Contributor.

Re: Connect-IT Help

Multiple ways to skin this cat.  :)  Just as an FYI much of the purpose of the Export Tool is to have the Export Script run periodically.  There is a command line for it just as there is for the Import Module.  Gnerally would get automated via the APM.  That said, there is nothing wrong with using CIT.  It is just heavier ordinance than might be needed.  I have never tried having an Export Script write to a shared folder or mapped drive though.

Cheers...  Russ

Russell Parker, CITAM, CHAMP, CSAM
President - Golden Ratio, Inc.
Russ.Parker@GoldenRatioInc.com
Top Contributors Last 30 Days