So I am trying to create a list where the index increments every time a new value is added but I am finding the following error in my expression

0
' So this is the expression that checks whether the list is empty or not if not it gets the maximum value and adds 1 to it , but I am getting   a empty expression error which I do not understand why
asked
6 answers
0

Hi Aditya,

 

I would recommend to add a Aggregate List activity before the Change activity, in which you count the amount of records in BreakdownList. Then you can simply do 'BreakdownListCount + 1' in the change activity.

answered
0

Hi Akshat,

make sure you are passing list into aggregate activity not the variable

answered
0

 

image.png

Hi this is what I am doing

 

answered
0

Hi Aditya,

 

I think the expression you have is in wrong syntax, please check the below docs to get an idea of using if statements in decisions

 

If Expressions

answered
0

It should look something like this:

image.png

 

answered
0

You can retrieve the existing Breakdown records sorted by BreakdownID in descending order

If you limit to 1 record, you will have the Breakdown record with the highest BreakdownID value. If you want to eg set the BreakdownID for a new record, you can then refer to $Breakdown/BreakdownID +1

You can also retrieve the entire list and use the aggregation 'maximum' to get the highest value and use that in the rest of your logic.

answered