Looping Actions

I am trying to create a loop similar to the one in "Looping with Actions (MV)" https://www.appsheet.com/templates/Examples-of-loops-using-actions?appGuidString=7b9ae746-1f51-4ecb-... .

I have a job "request table" which is related to a "job request components" table. From these I want to create a quote in the quote table and copy job components to the quoteitems table. The action to transfer the data over works fine when I try to run the loop the page becomes unresponsive. Below are the screen shot of the actions. Please assist.

SIDHR_1-1676572948484.pngSIDHR_2-1676573035255.pngSIDHR_3-1676573143038.png

 

 

 

 

 

 

Solved Solved
0 8 470
2 ACCEPTED SOLUTIONS

I would not expect, nor rely upon, a VC to update between iterations of the action loop. I think you've got an infinite loop. Set your List up as a real column, and add in another action in the group that removes the first index of the List between the add action, and the repeater.

View solution in original post

 I finally got it working. It turned out that the problem was that the column was of the type list. Once I turned it to text, it worked. As Marc_Dillon said, it does not work in the desktop view. I also took his advice and used a real column instead of a vc.

I also used lookup, find and mid functions instead of index.

lookup(if(FIND(",",[RealCNAQ])>0,left([RealCNAQ],FIND(",",[RealCNAQ])-1),[RealCNAQ]),"JobRequestComponents","Row ID","Component")

 

View solution in original post

8 REPLIES 8

I'd guess that you either have an infinite loop, or you're trying to generate a lot of new records and you just didn't give it enough time to process before deciding it was "unresponsive".

If the former, that'd depend on how you've defined your [components not added to quote] column.

If the latter, try cutting down your test cases first to ensure the concept works. If you do need to generate a lot of records, you may be better off using the API. Also, if you're using the new desktop preview, stop, it's currently way slower for these things.

There is a condition to stop the loop. I have only seven records to loop.

I don't think it is either because it does not even kick in. When I run the "add job component to quote ..." action, it runs and adds one record to the target table. When I run the repeater, it does not add any record.

Regarding column definition, please find below a screenshot of the column's settings. This may be the cause of the problem

 

SIDHR_0-1676579183188.png

 

I would not expect, nor rely upon, a VC to update between iterations of the action loop. I think you've got an infinite loop. Set your List up as a real column, and add in another action in the group that removes the first index of the List between the add action, and the repeater.

I believe I have done most of what you said.

I have created three virtual columns for Job components, Quoted components and job components not added to quotes. In the test phase, I have displayed these columns in the form see the image below. I have a condition to stop the loop. The test field in the image shows the output of the condition. When it goes to false, meaning that there is no item in job components not added to quotes list the actions become unavailable, suggesting that the condition statement is working.

I only get the unresponsive page error when I use LIST[Row ID]) in the reference row of the repeater action. Otherwise, it just does not loop.

SIDHR_0-1676609221863.png

The formula that I am using to extract the data from the JobRequestComponent table to the QuotedItems table is:

lookup(Any(Index([Components not added to quote],1)),"JobRequestComponents","Row ID","Component")

 

VC means virtual column.

I have created a real column and still getting the same outcome. Page is not responsive. 

NB: I agree that the real column will be more reliable. I will include it in final solution but still need to get the loop working. 

Also don't think it's an infinite loop because it does not even start.

 I finally got it working. It turned out that the problem was that the column was of the type list. Once I turned it to text, it worked. As Marc_Dillon said, it does not work in the desktop view. I also took his advice and used a real column instead of a vc.

I also used lookup, find and mid functions instead of index.

lookup(if(FIND(",",[RealCNAQ])>0,left([RealCNAQ],FIND(",",[RealCNAQ])-1),[RealCNAQ]),"JobRequestComponents","Row ID","Component")

 

Top Labels in this Space