UIPath pass Func(Int32,Int32) Argument

Hello people,

I’m having a problem with my easy workflow which browses a website and navigates to every value in a list. I have three arguments: The beginning and the end of the list as well as a step-function which is basically defined as Func(x) x + 1 (meaning in basic setup the workflow navigates to every number from beginning to end).

Now the problem is, that I can’t pass a different Function as argument in orchestrator. I tried a lot of different syntaxes but I didn’t find the right way to do it and only get Errors.

(Sorry for the messy picture, it shows the argument window on orchestrator and the error info received after starting with that argument. I can only add one picture so I just combined them)

I hope somebody can help me. Thank you for the taking the time and reading this.

Best regards

Hi welcome to the community!
What is this function as a parameter, is this something new?

Thank you, glad to be here! :slight_smile:
I don’t think it is that new. It is found in documentation as a type and I wanted to pass a function so I gave the input argument that type and tried but now I can’t enter the value in orchestrator :frowning:

In my package (I mean when designing the workflow in Studio) the value is
Function(x) x+1

I understand what this is, but orchestrator will work better with primitive parameter types, not sure if you can make this work when creating your process, but if you can pass there a different function, how would you use that in your process?

My Client wants to change step sizes and try out different step methods. To accomodate this I wrote a loop like that:

While Index <= EndIndex
Index = IntFunction(Index)

The goal is that my client can decide how to step over the list

Do you know whether this is possible?

You could use something to keep that Counter Variable “alive” outside your process, like an Asset or Config file…

I don’t really see how to do different loops depending on an asset or config file. Wouldn’t I have to parse a function from the config then? Isn’t that the same problem?

My goal is to be able to do

for( i = x ; i < y ; f ( i ) )

for any Int32 x and y and any function f. It’s ok if the loop bugs out because of improper use.

How would you go about saving and more importantly loading f to and from a config file or asset? I can’t imagine how to do it, but I really wanna pass the function f in any way!

Isnt the delegate function only there to return a number after a calculation? like the common thing will be that the loop will process every index (+1), if your customer does not want to go all the steps, then he will pass a different i and the loop will step over instead of processing every index, i think you can work something out to make it easier to pass in those arguments…