0
votes

I have a url: https://api.xero.com/api.xro/2.0/Reports/ProfitAndLoss?fromDate=2019-06-01&toDate=2019-06-30 which I will use after to call Xero's API.. I need to change fromDate and toDate dynamically. I thought to use https://api.xero.com/api.xro/2.0/Reports/ProfitAndLoss?fromDate=${start}&toDate=${end}. Then, add 'Data grid' with dates to be replaced in the string. But then, I tried to 'Set variables'/'Get variables' but I keep on getting the error 'Only 1 input row was expected to set the variables and at least 2 were received.' What am I doing wrong?

enter image description here Current transformation: enter image description here Transformation:

enter image description here

Sub-job:

enter image description here

Final transformation: enter image description here

1
Create one more transformation in sub job before final transformation 2and use get rows from result and then use set variable - Primit
@PKP, can you, please, take a look at drive.google.com/file/d/1C45A3tnzBvIIBwWTEXM11cqDLg36Adx3/…? I've added as you suggested but still the only one row gets passed/ - eponkratova
here is your file aws-pkp.s3.amazonaws.com/transformation.zip . I have checked a log. It seemed fine - Primit
I guess it is the specifics of the Xero step i.e. that it doesn't accept variables?! - eponkratova
It seems like variables are updated in Set/Get var, but then, it sends a request to Xero first without changing the var to the next value - eponkratova

1 Answers

1
votes

In the set variable you can only set one row. but if you want to pass multiple rows then I suggest you to use job. In job first transformation use Data Grid and then copy rows to result. then create one more sub job. For setting variable use transformation. Make sure execute at every input row is checked. this should be your subjob Structure