Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
SonTaki
Contributor
Contributor

Loop trouble

Hello!

I have a problem with the loop below. It is set to run 20 times with 5 seconds sleep block. If the condition is true, the loop should stop.

The issues is that this only works if the bookmark is available during the first iteration of the loop. Then the condition is evaluated as true and the loop exits. However, if the bookmark is not immediately available, the loop would run 20 times, always evaluating the condition as false.

What am I doing wrong? 🤔

Loop.png

8 Replies
PietMichielRappelet
Former Employee
Former Employee

Hi Sontaki 

I do not see any logical errors in your flow. Do you find in one of the iterations that the apply bookmark returns 'true'?
Could you please share the JSON export of your automation (right click in the editor - export workspace) so we can take an additional look? 

PietMichielRappelet
Former Employee
Former Employee

Hi Sontaki

Just noticed that you did use the 'string equals' formula while in this case you are comparing booleans.
Can you try with the 'istrue' formula in your condition? 

Hope this helps! 

SonTaki
Contributor
Contributor
Author

Hi Piet 🙂

No, if the first iteration returns 'false' then all 20 evaluations are 'false'. However, I can see in the app that the bookmark is created and the automation log shows that the Apply Bookmark block takes the correct bookmark_id as input but the output of the block is 'false'.

So the the problem must be related to the Apply Bookmark block. It either works the first time or does not work at all...

For some reason I could not upload the file to the community, here a link: https://www.transfernow.net/dl/202201119C6bfaYB

SonTaki
Contributor
Contributor
Author

Hi Piet, I have missed this reply, sorry.

This also does not work as the output of the Apply Bookmark block is always false (unless it is true during the first iteration).

SonTaki
Contributor
Contributor
Author

I have been trying to make this work for the past three days. No success...

Anyone with a fresh idea? I am stuck. 😵

PietMichielRappelet
Former Employee
Former Employee

Hi SonTaki.

It seems that you are making a retry automation for the Apply bookmark block and based on your feedback you always get an unsuccessful message when trying to apply a bookmark.

I do not see any issue with your automation, so I see 2 options
1) you are not sending valid app id and bookmark id's. This can easily be validated when looking at the automation history.
2) the block 'apply bookmark' is not working properly. In this case, please contact our support team and share an example with valid app and bookmark id where the response of apply bookmark is false. 

SonTaki
Contributor
Contributor
Author

Thanks Piet,

1) In the history I can see that the app and bookmark IDs are sent to the input block. I can also see that the Apply Bookmark block tries to apply the said bookmark ID, however, it either succeeds the first time or runs 20 times returning 'false'.

2) I just tried with List Bookmarks instead Apply Bookmark - exactly the same result. I think I am doing something wrong here.

Would you happen to have a json of a similar loop that works so I can compare?

In any case, thanks a lot for you help!

PietMichielRappelet
Former Employee
Former Employee

Hi SonTaki

The fact that apply bookmark always returns the same result ( in this case 'false') shows that the blocks work consistently. You do not need a retry mechanism in this case.

There are many reasons why a bookmark cannot be applied (e.g. locked fields, not data, ..). 

I suggest trying to apply the same bookmark in the same app through the UI.If this works without issues, please submit a support ticket.
Thanks.