Hi all,
I have a Power App with 3 screens.
Screen 1 - there is a button with OnSelect doing some stuff including this:
Set(maxEntries,2);
Set(entryCount,0);
Screen 2 - there is an icon with OnSelect doing some stuff including this:
UpdateContext({entryCount:If(IsBlank(entryCount),1,entryCount+1)});
If(maxEntries-entryCount=0,UpdateContext({showTimer: true });UpdateContext({startTimer: true }););
Also a label which shows this:
"Entries remaining: " & If(maxEntries - entryCount = 1, "One more!", maxEntries - entryCount)
Screen 3 - again a button with OnSelect:
Clear(myCollection);
Navigate(Screen1);
My intended flow is like this. The user lands at screen 1 and maxEntries and entryCount variables are initialised. In screen 2 the user types into a textbox (he only has two attempts) and after the last attempt a countdown starts and after 10 seconds the user is redirected to Screen 3. Then a collection called myCollection is cleared and user is redirected to screen 1.
What should happen is the cycle starts again, but what happens is the label in screen 2 starts at 0 and goes negative indefinitely, so I cannot enforce the max of 2 entries in the second cycle.
I think the issue is related to the entryCount variable since UpdateContext somehow seems to update only in the scope of Screen 2 and not globally. Or smth like that...
Hopefully I managed to describe the situation adequately. Any insight / comment will be highly appreciated.
Thank you very much in advance.