web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Help with LookUp function
Power Apps
Answered

Help with LookUp function

(0) ShareShare
ReportReport
Posted on by 125

Hello,

I'm trying to set up an app quiz.  I want to track progress, so if a user closes the app and comes back to it they will return to the last question they were on.

 

I'm writing their progress to sharepoint in a list then when opening the app trying to lookup where they got to and send them there.

There is the added function of a jail page, if someone tries to cheat, they go to jail for 10 mins.

The code is working to write the correct information to the list in sharepoint, but when closing and launching the app again it reverts back to the welcome page and doesn't take the user back to where they had left.

 

Under the APP in the tree view I've put this function.

Any help on what else I need to do would be really useful,

Thanks

 

StartScreen =

 

If(
LookUp('Campus quiz progress',Title=Lower(User().Email)).Jail= "True", Jail,
//First check users Jail value, if "True" send to Jail

 

Switch(
LookUp('Campus quiz progress',Title=Lower(User().Email)).Screen,
"Question 1", 'Question 1',
"Question 2", 'Question 2',
"Question 3", 'Question 3',
"Question 4", 'Question 4',
"Question 5", 'Question 5',
"Question 6", 'Question 6',
"Question 7", 'Question 7',
"Question 8", 'Question 8',
"Question 9", 'Question 9',
"Question 10", 'Question 10',
"Congratulations", Congratulations,
'Welcome Screen'
)
//If Jail is "False", Send user to screen value

 

 

Categories:
I have the same question (0)
  • jorge.daniel Profile Picture
    1,430 Super User 2024 Season 1 on at

    Hi,

     

    Maybe try OnStart and the Navigate function?

     

    Something like:

     

    Switch(
    LookUp('Campus quiz progress',Title=Lower(User().Email)).Screen,
    "Question 1", Navigate('Question 1'),
    "Question 2", Navigate('Question 2'),
    ...

  • Chwilkinson Profile Picture
    125 on at

    Hi jcfDaniel,

     

    Thanks for the reply, I had already tried doing that but it didn't accept the formula.

     

    I've got this message in the App checker, but I'm not using any @ symbols....

     

    Chwilkinson_0-1655465773340.png

     

  • jorge.daniel Profile Picture
    1,430 Super User 2024 Season 1 on at

    Try and break it into little pieces. Instead of sorting out the whole formula, write a simple one (maybe navigate to a hardcoded screen) and see if you can get it to work. Then, build on it.

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Chwilkinson ,

     

    When using Navigate functions, the formula need to be set in OnStart of the App control, rather than StartScreen. The error message was telling you that you have missing or superfluous symbols in that formula, the @ symbol is just the example. You can check the formula again to correct it. You can also paste your formula in the reply so that we can help correct it.

     

    Best regards,

  • Chwilkinson Profile Picture
    125 on at

    Hello,

    I've move that function over to the OnStart of the App controller, however its still just sending me to the welcome page although the list on SP under the Screen column is "Question 4".

     

    Here is the code I have on the OnStart.  I've included he notes so you can see what each part of the function should be doing.  Everything is writing to the sharepoint list correctly and updating progress, it just wont navigate back to the stored page when reopening the app.

     

    Set(UserEmail, Lower(User().Email));
    //get email address of current logged in user
    If(
    UserEmail in 'Campus quiz progress'.Title,
    false,
    Patch('Campus quiz progress',Defaults('Campus quiz progress'),{Title: UserEmail,Screen: "Welcome screen"});
    );
    //check if user has used app before, if not create record in SP and set to first screen

    If(
    LookUp('Campus quiz progress',Title=Lower(User().Email)).Jail= "True", Jail,
    //If User exists first check users Jail value, if "True" send to Jail


    Switch(
    LookUp('Campus quiz progress',Title=Lower(User().Email)).Screen,
    "Question 1", 'Question 1',
    "Question 2", 'Question 2',
    "Question 3", 'Question 3',
    "Question 4", 'Question 4',
    "Question 5", 'Question 5',
    "Question 6", 'Question 6',
    "Question 7", 'Question 7',
    "Question 8", 'Question 8',
    "Question 9", 'Question 9',
    "Question 10", 'Question 10',
    "Congratulations", Congratulations,
    'Welcome Screen'
    )
    //If Jail is "False", Send user to screen value

  • jorge.daniel Profile Picture
    1,430 Super User 2024 Season 1 on at

    Can you put this in a label and make sure it returns false? UserEmail in 'Campus quiz progress'.Title

  • Verified answer
    Chwilkinson Profile Picture
    125 on at

    I have fixed the issue

     

    LookUp('Campus quiz progress',Lower(User().Email) in Title).Screen,

     

    There is a delegation warning, but I have a small enough user group that it will not be an issue.

     

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard