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 / Return to a form Item
Power Apps
Unanswered

Return to a form Item

(0) ShareShare
ReportReport
Posted on by 254

Hello a have a screen, which contains gallery and a form, but I don't know how return information about this item into form.

Untitled.png

How code may look:

If(
 Not(IsBlank(LookUp('Disputed cases', PrimaryKey = 'Primary Key' And ErrorCode = 'Error code'))),//if this item exist in datasource
 LookUp('Disputed cases', PrimaryKey = 'Primary Key' And ErrorCode = 'Error code'),//return it
 Otherwise return form, where will be filled only "Title" and "Error code"(will be returned from gallery)
)

I don't know how to write else part, and I am not sure that "then" part is correct. Should be this code for item properties?

Thank you

Categories:
I have the same question (0)
  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Hi @Aleksandra1 ,
    If you get blank result i.e. if the item doesn't exists, you can hide the form or pull latest entry from Sharepoint list. To hide the form,

    1. OnVisible property of the screen use below formula - 

     

    If(IsBlank(LookUp('Disputed cases', PrimaryKey = 'Primary Key' And ErrorCode = 'Error code')), Set(isFormVisible, false), Set(isFormVisible, true))

    2. Set visibility of the form to isFormVisible variable

    3. Add a label and set visibility of it to !isFormVisible and you can add message in Text property of label stating that no item is there in SP list.

    You can use below formula in Item property of the form to get latest item from SPList if selected item is not there in Datasource and no item in gallery is selected - 

    If(
     Not(IsBlank(LookUp('Disputed cases', PrimaryKey = 'Primary Key' And ErrorCode = 'Error code'))),//if this item exist in datasource
     LookUp('Disputed cases', PrimaryKey = 'Primary Key' And ErrorCode = 'Error code'),//return it
     If(!IsBlank(GalleryName.Selected), LookUp('Disputed cases', PrimaryKey = GalleryName.Selected.'Primary Key' And ErrorCode = GalleryName.Selected.'Error code'), Last('Disputed cases')))
    )

     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 474

#1
Valantis Profile Picture

Valantis 474

#3
WarrenBelz Profile Picture

WarrenBelz 375 Most Valuable Professional

Last 30 days Overall leaderboard