Forum Discussion

skline4552's avatar
skline4552
New Contributor
4 years ago
Solved

Generating a unique (but consecutive) ID that resets daily

My end user wants a unique ID that consists of “YY” + “DDD” + 12-digit consecutive number that resets to 1 each day - so it would be: 000000000001 000000000002 000000000003… The date parts ar...
  • koryknick's avatar
    4 years ago

    Welcome to the Community @skline4552!

    You can use the Public Monitoring API to get the pipeline execution statistics for the currently running pipeline and check the response count. This will include counts for every actual execution of the pipeline (ignores validations). Note that you could add query parameters to filter to only Completed jobs so you don’t miss numbers for jobs that didn’t complete successfully (see documentation).

    Here is a small example pipeline that makes the call, which you can simply copy and paste the snaps into your pipeline since it works by using the currently executing pipeline metadata to build the call. Note that you will need to configure a REST Basic Account for the Rest Get snap with SnapLogic credentials that have Read+Execute access in your folder to be able to make the call or you will get an Unauthorized error.
    Community 13552 - Pipeline executions today_2022_10_05.slp (4.7 KB)

    Hope this helps!