Static Transform - Add days based on current date

Hello guys,

Can you tell me a way to add X days based on the current date using STATIC transform?

We have a scenario where the number of days a user can keep their account active will be filled out via a form. After filling it out, I need to get the current date and add up the days the user filled out on the form.

This is not possible using Date Math, because the expression variable only accepts the mocked number.

@originalmths

Could you please deep dive into how you are retrieving the form filled data (date/days) into the transform?

Are you strong this data in account or identity attribute and retrieving it into transform?

Thanks
Raghu

The idea is as follows:

The requester will request a role, this role will trigger a workflow that sends the form to the requester. This form is responsible for collecting data that another workflow will later be responsible for creating an account in a csv source.

There is a field in the form that stores the number of days that the user can keep the account. Maximum of 30 days.

If the requester fills in 5 days, for example, I need to take the current date when the account was created in the source and add another 5 days. With this, I will have an expiration date.

1 Like

Assuming you are using Form Submitted Workflow trigger to capture the input of the form. You can use define variable operator and in that you can use $.now() to get the current date and in the same variable you can add operation as Add time. It’ll look something like this:

1 Like

And this account that the workflow will create in a csv source is linked to an identity profile. In other words, the accounts that are being created via workflow will later become identities in Sailpoint.

In place of length you need to pass the user input

Yeah, i try this.

The problem is that “Add Time” only accepts numbers. And when I pass my field that stores the number of dates, it can’t do the sum. Returning the following error:

error parsing input (type: Unexpected Error, retryable: false): error parsing input""

Can you share the example?

ActivityTaskScheduled,“2024-09-13T14:01:15.261591695Z”,“{”“displayName”“:”“Define Variable”“,”“input”“:{”“id”“:”“sp:define-variable”“,”“variables”“:[{”“description”“:”“expiration date”“,”“name”“:”“data”“,”“transforms”“:[{”“id”“:”“sp:transform:addTime:time”“,”“input”“:{”“length”“:”“5"”,““unit””:““days””}}],““variableA””:““2024-09-13T14:01:15.257Z””}]},““stepName””:““defineVariable””,““task””:““sp:internal:operator:mutative””}"

ActivityTaskStarted,“2024-09-13T14:01:15.261622607Z”,“{”“attempts”“:1,”“displayName”“:”“Define Variable”“,”“stepName”“:”“defineVariable”“,”“task”“:”“sp:internal:operator:mutative”“}”

ActivityTaskFailed,“2024-09-13T14:01:15.274015656Z”,“{”“displayName”“:”“Define Variable”“,”“error”“:”“error parsing input”“,”“stepName”“:”“defineVariable”“,”“task”“:”“sp:internal:operator:mutative”“}”


Its a select field in forms

Since it returns a string, I believe that is why I can’t use the “Add Time” from Define Variable.

Just tested this yes the string might be a reason for the parsing issue .

Yes, because of this I need help to set up static via. If it were possible in Define Variable, it would be better.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.