Lise
Lise

Reputation: 1

How to change the start screen based on a condition in Power Apps?

I searched a long time online, and I tried a lot of things but it's going nowhere (Lookup, IsBlank, Len, First, Switch, Navigate, OnStart, StartScreen, DataCard...).

First I have one list (List1) in Sharepoint. In this list I have multiple columns. What I want from my PowerApp is to open the Screen1 if the cell in ColumnX (date type) of the selected item is blank (no data), and Screen2 if there is a record (for ex: 10/17/2023).

Whatever I do, when I double click on an item to modify it, it doesn't work. It always opens the same screen, no matter the selected item.

You can see some of the things I tried :

If(IsBlank(DataCardValueCell),Screen1,Screen2) - in App.StartScreen, returns false either their is something or not If(IsBlank(List1.ColumnX),Screen1,Screen2) - in App.StartScreen, same If(LookUp(List1.ColumnX,'ColumnX'=Blank(), true), Screen1,Screen2)

I also tried to Refresh() and to do the same in App.OnStart . Refresh the website page before selecting another item doesn't change anything either.

I think it's because it checks the whole Table but I can't manage to have only the cell I want.

Thanks for your help in advance, I really appreciate !

Upvotes: 0

Views: 3239

Answers (2)

ZeekLTK
ZeekLTK

Reputation: 233

I think you have to connect to the SharePoit list as a data source and then use a LookUp inside IsBlank to find the specific cell value. Something like:

If(
    !IsBlank(
        LookUp('SharePoint ListName', 'SharePoint ColumnName' = Text(Today()))
    ),
    // Date exists
    Screen1,
    // Date does NOT exist
    Screen2
  )

Upvotes: 0

Ganesh Sanap - MVP
Ganesh Sanap - MVP

Reputation: 2228

If you are customizing the SharePoint Online list form using Power Apps,

You can get the column values from SharePointIntegration object as well.

Try setting App.StartScreen property to:

If(
    IsBlankOrError(SharePointIntegration.Selected.ColumnX),
    Screen1,
    Screen2
)

and see if it works for you.

enter image description here

Upvotes: 0

Related Questions